Using GIT Properly

Using GIT Properly

Coding, Guide
Everyone needs to get into the habit of branching when they use GIT. Whether it's a new feature, a bug fix, or a small improvement to some existing code, every ticket should get its own branch. Do some work on this branch, committing early and often (for instance, whenever your tests pass). Also make sure to use the Atomic Approach to creating commits. It shouldn’t be uncommon for you to have 10-30 commits per day. Atomic Approach • Commit each fix or task as a separate change • Only commit when a block of work is complete • Commit each layout change separately • Joint commit for layout file, code behind file, and additional resources The seven rules of a great Git commit message 1. Separate subject from body with…
Read More
Auto Follow Twitter Users

Auto Follow Twitter Users

Coding
I'm often tasked with building a twitter user's following. This script is for the console of your web browser and it will click all of the Follow Buttons for you automatically. var FOLLOW_PAUSE = 1250; var FOLLOW_RAND = 250; var PAGE_WAIT = 2000; __cnt__ = 0; var f; f = function() { var eles; var __lcnt__ = 0; eles = jQuery('.Grid-cell .not-following .follow-text').each(function(i, ele) { ele = jQuery(ele); if (ele.css('display') != 'block') { console.trace('Already following: ' + i); return; } setTimeout(function() { console.trace("Following " + i + " of " + eles.length); ele.click(); if ((eles.length - 1) == i) { console.trace("Scrolling..."); window.scrollTo(0, document.body.scrollHeight); setTimeout(function() { f(); }, PAGE_WAIT); } }, __lcnt__++ * FOLLOW_PAUSE + Math.random()*(FOLLOW_RAND) - FOLLOW_RAND/2); __cnt__++; }); } f(); Unfollow People who Don't follow you! $('.ProfileCard-content').each(function () {…
Read More
MySQL Best Practices

MySQL Best Practices

Coding, Guide
Database operations often tend to be the main bottleneck for most web applications today. As programmers need to do our part by structuring tables properly, writing optimized queries and better code. Table Names By convention, the "snake case" in lowercase (no PascalCase - we're not using Microsoft SQL Server here!), plural name of the class will be used as the table name unless another name is explicitly specified. Tables should also be named based on their respective contents. Try to avoid naming tables based on a single use case and think more about how that table will be expanded in the future. If you're not sure how to name the table ask your manager before creating it. eg: To find an order product we would look in the order_products table  Primary Keys The…
Read More
Star Wars Fate Accelerated Ideas

Star Wars Fate Accelerated Ideas

Gaming
If you have any thoughts or ideas, don't forget to post a comment in the reply area at the bottom. Approaches Choose your approaches. Approaches are descriptions of how you accomplish tasks. Everyone has the same six approaches: Dexterity - Blaster, Brawling, Running, Dodge, Etc. Knowledge - Alien Races, Planetary Systems, History, Etc. Mechanical - Piloting, Navigation, Sensors, Etc. Perception - Con, Bargain, Command, Persuade, Etc. Strength - Fighting, Climbing, Stamina, Etc. Technical - Programming, Droid Repair, Etc. Each approach is rated with a bonus. Choose one at Good (+3), two at Fair (+2), two at Average (+1), and one at Mediocre (+0). Force Points (aka Fate Points) - use to activate aspects +2 to a roll or reroll dice. Each player begins each session with 3 Force Points. Aspect…
Read More
What I Use 2016

What I Use 2016

Opinions
The updated 2016 list of my gadgets, computers and software I use on a daily basis. Computer(s) Computer: MacBook Pro I continue to use my Mid 2014 MacBook Pro 13" with an attached 23" monitor. It's fast, has crazy long battery life, and works perfectly for doing coding or layout on my book. Smartphone: Samsung Galaxy S7 Edge Best phone I've used hands down. Fast, great screen, waterproof and everything just works. Tablet: Onda 919V Dual Boot The Onda 919V 3G Air continues to be my go-to tablet. The screen had an issue and it took 6 months to get fixed. I don't know that I'd recommend it. Save your money and get a Samsung or Apple. Apple Magic Mouse Still using this mouse. No complaints. Ubuntu Servers Our home server has been replaced…
Read More
Summernote Image Upload

Summernote Image Upload

Coding
NOTE: This only applies to Summernote 0.6.* and not to newer versions. $('#summernote').summernote({ height: 850, toolbar: [ ['style', ['fontsize','fontname','bold', 'italic', 'underline', 'clear']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph','hr','link','picture']], ['src',['fullscreen','codeview']] ], onImageUpload: function(files, editor, welEditable) { sendFile(files[0], editor, welEditable); } }); function sendFile(file, editor, welEditable) { data = new FormData(); data.append("file", file); $.ajax({ data: data, type: "POST", url: "/admin/upload", cache: false, contentType: false, processData: false, success: function(url) { $('#summernote').summernote('editor.insertImage', url); } }); }
Read More
Connecting to Ubuntu Servers With RSA Keys

Connecting to Ubuntu Servers With RSA Keys

Coding, Guide
I manage a bunch of internal servers and for those that aren't part of the wider web I like to use key pairs to speed up my sign ins and maintenance. Key-Based SSH Logins Key-based authentication is the most secure mode of authentication usable with OpenSSH. Key-based authentication has several advantages over password authentication, for example the key values are significantly more difficult to brute-force, or guess than plain passwords, provided an ample key length. Key-based authentication uses two keys, one "public" key that anyone is allowed to see, and another "private" key that only the owner is allowed to see. To securely communicate using key-based authentication, one needs to create a key pair, securely store the private key on the computer one wants to log in from, and store the…
Read More