Posts

Showing posts from 2017

Linux Cheatsheet

With everything going on with logicoma, I will be frequently updating this page so I can just jump back into whatever system tasks at hand. I should add this I'm going to keep this focused on ubuntu/debian. http://www.yolinux.com/TUTORIALS/LinuxTutorialAdditionalHardDrive.htmlhttp://www.cyberciti.biz/faq/linux-viewing-drive-partitions-with-fdisk-parted/X11 Forwarding using Putty on Windows - YouTubeStoragehttp://tldp.org/LDP/lame/LAME/linux-admin-made-easy/checking-storage-space.htmlhttps://www.cyberciti.biz/faq/linux-check-memory-usage Commandsfdisk -l mkdir ← a directoy of where to mount the disk mount ← mount a disk using /dev/[disk]
ln ← creates a link file from another
name ← use 'a' to get all the information on the server

More coming soon...

Javascript Cheatsheet

At times I do still just use pure javascript and nothing else because how small I want the project to be. As always more coming soon...
JavaScript best practices19+ JavaScript Shorthand Coding TechniquesBest way to find an item in a JavaScript array? - Stack OverflowReplace multiple whitespaces with single whitespace in JavaScript string - Stack Overflowjavascript - How can I disable highlighting in html or JS? - Stack Overflowjavascript - drag and drop, prevent awkward highlighting? - Stack OverflowBasic Json RequestUsing XMLHttpRequest Performance
   There is a lot of talking about how to test the real performance of javascript and for the most part I have no clue where to start as I write this. Hopefully that will change be the end, skip to it if you dont want to learn the process as well.
http://stackoverflow.com/questions/1003855/howto-benchmark-javascript-code
Fun Example 
function DisplayQuestions() { var Questions = new Array(20); Questions[0] = "Question #1"; Qu…

EF6 Cheatsheet

Image

IIS Cheatsheet

Setting up a website in iis is pretty easy and its where I'm most comfortable doing my professionally work. However with newer frameworks I'm look outside of iis because of the non-window based servers. So this cheatsheet is even better because I'm sure it will be a long time before convince my peers to use linux.
Server Error: HTTP Error 500.19 - Internal Server ErrorASP.NET IIS Registration Tool (Aspnet_regiis.exe)How to Configure HTTP Access to SQL Server 2008 Analysis Services on IIS7Reverse Proxy with URL Rewrite v2 and Application Request RoutingSecurity & UsersWhat are all the user accounts for IIS/ASP.NET and how do they differ?Solutioniis 7 - IIS7 Permissions Overview - ApplicationPoolIdentityhttp://msdn.microsoft.com/en-us/library/k6h9cz8h(v=vs.80).aspx IIS with Node (side note)
Installing and Running node.js applications within IIS on Windows



C++/C Cheatsheet

Sql Cheatsheet

After my first job I realized the importance of learning a bit about it all. None should be in the dark when it comes to their website. I might not be a master of relational databases but give me a mongodb or reddis and even a firebase database any day. Still some projects are dependent on mysql and etc so I have enough info to help me move forward. Nothing I had more than a dba or team who locks me out. Throw exception from SQL Server function to stored procedure - Stack OverflowHOW TO: Return Errors and Warnings from a SQL Server Stored Procedure in ADO.NETRAISERROR (Transact-SQL)SQL server management studio local database connection error in windows 7Visual Studio Database Guide - HomeHow to: Use Source Control with SQL Server Management Studiomysql - Sending multiple data parameters with jQuery AJAXsql server - Inserting multiple rows in a single SQL query?LuaSQL: Database connectivity for the Lua programming language
More coming soon..

Certificate Providers & ISPs

Jquery Cheatsheet

Time to time I still use jquery and honestly don't have too many complaints about using jquery over more modern frameworks. Either way keep coming back to this page for reminders or small bugs in my code that I forget to add. I think the best approach for anyone is to create plugins for their needs and just keep expending around that.
Javascript - Event orderlightbox for images, videos, YouTube, iframes, ajaxdeferred.always() | jQuery API Documentation.trigger() | jQuery API DocumentationjQuery advantages/differences in .trigger() vs .click() - Stack OverflowjQuery BlockUI PluginHow to detect pressing enter on keyboard using jquery? - Stack Overflowjquery - Last element in .each() set - Stack OverflowjQuery event.preventDefault() not working in Firefox (JSFiddle included)jquery - Checking to see if AJAX response is empty and other problemsjavascript - jQuery's $(form).submit() not firing for IE only (MVC3 app)javascript - How can I refresh a page with jQuery?Plugins Awesome Bub…

Travis-Ci & Saucelabs Environment Variables

Firebase's example on how to auto deploy with Travis shows us a more secure way rather than how I did. fassetar/jquery-maskmoney if I can create a similar approach with this project I would feel better about the security.

https://github.com/fassetar/site/blob/master/.travis.ymlhttps://github.com/fassetar/jquery-maskmoney/blob/master/.travis.ymlhttps://docs.travis-ci.com/user/environment-variables/https://docs.travis-ci.com/user/encryption-keys/https://saucelabs.com/platformsMore coming soon...

Powershell Cheatsheet

Make Promises to Your Work Not Your Employer

Image
I've learned a lot in the past x amount years or whatever I'm not keeping track anymore. For the most part I've learned that I've been doing works. On that part I think I've made some good decisions. For the things I've got wrong I believe its just a matter of how I approached them. Mostly so I believe it was a lack of confident that played into other people's favor. Recently I've no longer allowed this to be an acceptable approach for people to take as my decisions are final. It is just as easy for me to move on rather than work around something in a project because of another developer's difficultly to agree with me.  Regardless how people see me or if they understand my method I only have one bit of wisdom to pass on to next generation. Which is lazy people will lie and will continue to lie to you regardless if you have evidence of better way. For years its confused me on why lazy people sell themselves better and its because its a simpler ap…

Git Cheatsheet

I'm always handling the code wherever I go so maybe its time I shared my notes. I'm really surprised but I should with my experience how many developers don't know git.
msysgit - git: 'credential-cache' is not a git commandHow do I update the password for Git?How do you attach a new pull request to an existing issue on github Squash commits!
I'm always forgetting this and its really simple to do if you remember both commands.

git rebase -i xxxxxxxxxxxxxxxx
git push --force origin master "where xxxxxxxxxx is the SHA of the commit upto which I've to squash"


Get username

git config user.nameChange Email
git config user.emailCaching Password on Windows.

git config --global credential.helper wincred

More coming soon...

Gimp Cheatsheet

I really should just get a graphic's designer to do all my work but that's probably the words of every developer has said. I don't have the skills or patience but sometimes my needs are very simple and that's really what I work with for my games. Someday I'll pay for one, maybe when I make actually money off my games.

How to Smooth an Images Edge After Resizing - YouTubeGIMP White Background Removal Tutorial - YouTubePixilze an Image More coming soon..

Presteps to Making My Own CMS

A lot of these notes here are just my experiences and design changes to orchard cms for the pre-setup into how I will create my own cms. For my own cms I will not be using any of orchard's code but my experiences will help, also by getting familiar with orchard so I can move forward with my employer on other legacy applications that are dependent on aspnet 4.5. So its a win on both sides.

Major Design Changes:
SafeMode Theme - Removed/MovedOriginally I was completely against having this feature at all however with some thought I think its a matter of default behavior in the core/module features. I did something similar with the Admin Theme menu.cshtml. Instead of changing the tag element view in the core file I simple rewrote the look of the admin menu. Instead of the admin menu adding all the classes to the li tag in the for-loop they are placed in the link tag for fontawesome. The key is no css or javascript just the html. SafeMode can only be used for display purposes at best. T…

A Dependency of Dependency Inject

Image
I have voiced my opinion in the past on dependency injection, and even got myself in some stupid conversations with other developers who are little obsessed with this topic. I was first caught off guard because I questioned for my support for angular which I'll come back to in a minute. My first rule for using any tool or technology is to using it for its greatest strength and really use it or not at all. Which is creating tests around my code and creating versions of those dependencies."we need dependency injection for unit testing/scalability".  Neither of these reasons are wrong and I agree them but if you build blindly follow them without reason you miss the point. I one point used Ninject, and was actually stumped on the explanation given. This was because up to that point dependency injection was something I understood how to use but not its method. However I moved pass that point and started making my opinion clear. Show me the tests! The reason I given was s…

3D Printer - Electrical Notes

Image
Last year I bought a really cheap 3d printer  which was a self-built kit based on the priums 3. Its been years since my beginner course high school on electric. However I didnt have any issues picking things backup and getting to working. The printer I got have zero notes or instructions but for $110 what can you say.

Notes
"The AC "L" and "N" probably mean "Live" and "Neutral" respectively. The ground next to it is the Earth ground. The V+ and COM are the DC output terminals, which you could also say are V+ and V-, respectively" BLACK = HOT WHITE = NEUTRAL GREEN = GROUND If you use a computer power cord or other cord based on the international wiring color code: BROWN = HOT BLUE = NEUTRAL GREEN/YELLOW STRIPE = GROUND


I did burn out a fuse on my board but I don't think it was my fault because the fuse was 5amps instead of 10 like the second fuse on my board. Went online and but a similar fuse as the second one and now things ar…

Bootstrap - Static Table Header

Image
With this solution I limiting myself to just css as much as I could without javascript. The draw backs are writing out multiple css selectors and statically writing out the width of column. Also I had to make a max-height for the table, which I was already doing.

I could have easily added ag-grid or ui-grid but I wanted to keep it simple and look at the performances. From a development point of view I would say the time to setup either approach is the same. That is building out this static approach verses just using a library. From the image you can see the max-height is only applied to the tbody.  I'll place the code in my github repo when I'm ready.


AppScript for Blogger Sync

This a project I've given up since I'm creating my own platform but I want to include my notes incase someone wanted to continue my work. Probably going to happen but maybe someone could create it so a person COULD use their google drive to organize their blog. Like create blog posts and have them in a folder separate from everything else so you could use the UI in google drive.

https://security.google.com/settings/security/permissionshttps://script.google.comProjecthttps://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/bloggerappAPIhttps://developers.google.com/blogger/docs/3.0/using#nullhttps://ctrlq.org/code/20068-blogger-api-with-google-apps-scripthttps://mashe.hawksey.info/2015/10/setting-up-oauth2-access-with-google-apps-script-blogger-api-example/External Service?https://developers.google.com/apps-script/guides/services/external#connecting_to_public_apis

Gcloud Vs. Azure Comparison With Aspnet Core

Image
Since I no longer use both cloud services I thought I would write down out my experiences. This is going to be really quick because its mostly just what I saw with my company site as far as costs and development on each platforms. This note isn't the be all comparison, just a few statements on what I saw and experiences so do your own research and experimenting on each platforms.
Tools (Visual Studio 2015) Without a doubt azure is the better choice but I was really surprised how much there was for glcoud. In fact there is even a plugin for to deploy your app. Gcloud even making docker support easy, the only differences  with visual studio was how you deployed to each platform. Which I like that they were not the same but it did take a long time when I deployed to gcloud. The time was about 10-15 mins sometimes and I'm sure the team is working on it but azure is the winner for this.
Logs - Glcoud Checking your logs in gcloud is surprisingly easier if you are not using app insigh…

Custom Data Scripting

This is just the name I like to call for the way I write my javascript. Which looks at the dom for configuration rather than in a script file or some api. This is a style of javascript that allows non-javascript developers to jump in if they can read basic html elements. There are many reasons why I use this approach other than the other two. For example to minimizing the overall javascript code which simplifies the website. I took this approach up because of what I learned with Aspnet razor syntax. Later made improvements to the style once I learned anguar/react (components).
  Now I don't not what other developers call this style or if they even acknowledge this pattern. I'm giving it a name cause I need a way to define it. Plus its easily explain to other developers where to look for with my code. The goal here is to always look at the Dom for something and if I need more complex stuff then place it in a object. However I could always argue that one could go back and makeu…

Project Base Organization

For ever idea and project that has popped in my head, I created a folder. And for over the past six years I've used this approach with some success. Or maybe I'm bias cause I enjoy using this approach. Either way  I do think I've make some headway especially in the last year. For example mypatco is a folder, mostly filled with android, firebase and gcloud links. For more complex problems where the answer isn't in a link. There's my blog or google docs. From there I have kind of a system where a read me file that explains were I left off. Other files are broken up based on the problems or task I need to achieve. All are referenced in the read me and from there I determine my goals are being meet.      More recently I have taken this same approach to a git repo server. Just like any application in a repo things pretty much the same.looking back I guess I was always following a practice kind like waterfall or agile but that was before I knew what they were. Very inter…

Can't Join Them, Rebuild Them

Image
For a while now I've changed my thoughts on how I want to move forward in my career. If I can't get a job at the company I want then I'll start making my own. With all the benefits that comes with it and along the way maybe help current and future employers (but its mostly for me). Building large enterprise systems that not only meet the same level of other big name company applications but have a concise and simpler architecture for performance and development . Leaving me with zero question on the implementation.
List of Apps Note - StartedShare notes between different accounts on same device or just different accounts.Blog - (based off blogger/orchard recipes extended)better syntax writing, no external system needed.github backup and unit testing for html markup.(maybe link testing with junit)direct api services better theming and default server valuesjson based recipes rather than xmlAnalytics - Started mobile featuresmobile navbar and css standardsBrowser - 2029Better d…

Eye Tracking Project Notes

One of the main reasons I bought a 3d printer was to explore the idea of creating a headset with a medium to low end camera attached to it.  With a enough luck create a device that would work by tracking the eye. At the moment I'm putting this project on hold but I want to look at these resources later.

Open Source Projects
Eye Trackinghttps://sourceforge.net/projects/gazepointer/?source=navbarpupil-labs/pupil: Open source eye trackingPyGaze | Open source eye-tracking software and more.OGAMA (OpenGazeAndMouseAnalyzer)Devices and Alternativeshttp://www.gazept.com/product/gazepoint-gp3-eye-tracker/

Angular: Custom Value Checkbox

Sometimes the dba won't change a field's datatype in the database which why handle all my databases now days. Just some quick notes for handling custom values to send back to the database for a form post. Using angular 1.5...

<inputtype="checkbox"ng-model="item.selected"ng-true-value="'TRUE'"ng-false-value="'FALSE'"/> - "add quotations because it's an angularjs expression and it also needs to be a constant" 

Resources

http://plnkr.co/edit/ehXObXaXicC1BvKyQtmI?p=previewAngular view not updating when checkbox clickedPassing dynamic value with single quote as a ng-true-value expression fails

Don't Prompt for Permissions without the User's Direct Interaction

Image
For all the applications out there! Stop pushing for permissions and stop probing for information without reason. Regardless of your necessity for a feature a user is the right for not installing or using an app without clear intent. Action from the user are a direct link from the developer to the client for clear reason and intent on why they need permissions. I see this now and again with website using geo-location and never giving a reason on why the need the permissions but sure enough its the first prompt I get on their site...  This why I really like the recent changes with android its a little annoying for coding but the information needed for the user on why you need some information is clear. I always have to fight with project managers on whats initiate and I can be more direct on why I need something than from what you are asking me to do. There is still room for error (security issues) with a client if they still don't trust an application which I always say they can …

VS 2015 - The Operation Could not be Completed Invalid Pointer

This bug appears to happen in both visual studio 2015 and 2010 but I've only run into it for 2015. I'm not sure what I did to cause this other maybe moving around projects. I don't think that was the cause but I do sometimes delete the appdata folder. My solution for this bug is simple delete the AppData folder again (hahah).  I found from other sites that is the ComponentModelCache folder specifically that you want to delete. It goes without saying close all visual studio windows before doing this. Folder Under: C:\Users\{YourUsername}\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache

User-Agent Styled Web Applications

This idea came from awhile back when I was working on my project rustkickers. The purpose of the site is to provide documentation on all things motor related. While working on a demo for the site used a old car manual to create some of the designs. That goes me thinking why not make multiple site designs around different car manufactures. Then even further down the rabbit I landed here, which is what this article. Another thought but a cool one I think and yes I know you can't trust the user-agent but it doesn't matter its just the style not the content. 

Intial Solution
Optimizing content for different browsersFilter based on webkitChrome conditional commentsIs there any equivalent to IE conditional comment for chrome and safari?IE10 CSS Hacksload webfonts through the offline storage cache manifestAfter playing around with this idea for awhile I figured handling this is the frontend at all was not worth it because of performance. Unless your looking at it with a single css a…