Skip to content

Instantly share code, notes, and snippets.

Avatar

Akinjide Bankole akinjide

View GitHub Profile
@akinjide
akinjide / gist:fa8d7218bedd663aabcd
Last active Sep 3, 2015 — forked from buhrmi/gist:1344659
Sublime Text 2 Git Annotation Colors
View gist:fa8d7218bedd663aabcd
<dict>
<key>name</key>
<string>Git Modified Line</string>
<key>scope</key>
<string>git.changes.x</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#272852</string>
</dict>
@akinjide
akinjide / gist:9aba468f51a4fdede974
Created Nov 14, 2015 — forked from learncodeacademy/gist:5850f394342a5bfdbfa4
SSH Basics - Getting started with Linux Server Administration
View gist:9aba468f51a4fdede974

###SSH into a remote machine###

ssh user@mydomain.com
#or by ip address
ssh user@192.168.1.1

exit: exit ###Install Something###

#If it's a new server, update apt-get first thing
View .git-commit-template.txt
# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)
@akinjide
akinjide / .jshint
Last active Mar 17, 2017
jshint configurations
View .jshint
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@akinjide
akinjide / prototypal.js
Created Mar 22, 2017
JavaScript Prototypal Inheritance
View prototypal.js
function ParentScope(){
this.aString = "parent string";
this.aNumber = 100;
this.anArray = [10,20,30];
this.anObject = {'property1': 'parent prop1', 'property2': 'parent prop2' };
this.aFunction = function(){ console.log('parent output'); }
}
function ChildScope(){
}
@akinjide
akinjide / style.less
Created Apr 18, 2017
Atom Operator Mono And Fira Code
View style.less
// ...
atom-workspace,
atom-text-editor {
font-family: "Fira Code";
text-rendering: optimizeLegibility;
font-size: 17px;
font-weight: 400;
line-height: 1.8;
}
@akinjide
akinjide / guess.py
Last active May 5, 2017
A simple Guess The Number game implementation in Python.
View guess.py
from random import randrange
class Guess:
def play(self):
print "The computer will select a secret number between 1 and 10."
print "Try to find the secret number using a minimum number of guesses."
play, secret, guess, guesses, answer = True, 0, 0, 0, None
while play:
View git_commands.md
GIT COMMAND FUNCTION
git init Make the current folder Git enabled
git config --global user.name "Akinjide Bankole"  Identify yourself for commits
git config --global user.email "r@akinjide.me" Identify yourself for commits (remove --global for a specific project)
git status Show the working tree status (with .git inside)
git add filename.ext Add file to stage
git reset filename.ext Remove file from stage
git rm filename.ext or '*.ext' Remove file from stage and delete
git rm -r directoryname Remove directory from remote
@akinjide
akinjide / asi.js
Created May 11, 2017
JavaScript nasty ASI (Automatic Semicolon Insertion)
View asi.js
var hello = "Hello World"
console.log(hello)
// Error.
(function() {
console.log("¯\_(ツ)_/¯")
}())
// Solution 1
;(function() {
@akinjide
akinjide / async_await.js
Last active May 14, 2017
Understanding Async/Await
View async_await.js
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
async function breathe(log) {
log('Breathe in @@@')
await delay(3000)
log('Breathe out')
await delay(1000)
log('3 @@@')
await delay(1000)
log('2 @@@')
You can’t perform that action at this time.