Skip to content

Instantly share code, notes, and snippets.

Sublime Packages control
Download from https://packagecontrol.io/installation
Put your cursor on the word wood and use * and # to move back and forth between the two matching words.
now let's find the word wood, but first let's move to the top of the file with gg. Then press G to move to the bottom.
when you're at the bottom of the file type /wood. This will find the first matching pattern. to cycle through all matches
you will use the n (next occurance) and N (previous occurance) keys.
next, you're going to start deleting some characters. go to the next line and put your cursor on top of the character that's out of place.
then press the x key to delete it.
***************
HTML
***************
<h1 id="message"> Log Output </h1>
<p id="log"> </p>
/*** ? Ternary ***/ 4-8-2015
condition ? true : false;
(a === b) ? alert("yes") : alert("nope")
/*** typeof ***/
@jjsub
jjsub / Recursive
Last active August 29, 2015 14:18
/*Simple recursive Factorial recursive function */
function fact(n){if(n === 0){return 1;} else{ return n*fact(n-1);}}
or
function fu(n){ return (n == 1|| n == 0) ? 1 : n * fu(n-1); }
@jjsub
jjsub / CSS
Last active August 29, 2015 14:18
/* Show the border of all the element */
*{
border: 1px solid red;
}
/* import font */
@import url(http://fonts.googleapis.com/css?family=Noto+Sans);
txtblk='[\e[0;30m]' # Black
txtred='\[\e[0;31m\]' # Red
txtgrn='\[\e[0;32m\]' # Green
txtylw='\[\e[0;33m\]' # Yellow
txtblu='\[\e[0;34m\]' # Blue
txtpur='\[\e[0;35m\]' # Purple
txtcyn='\[\e[0;36m\]' # Cyan
txtwht='\[\e[0;37m\]' # White
txtrst='\[\e[0m\]' # Text Reset
Simple HTML
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
THE DIFFERENCE BETWEEN GIT PULL, GIT FETCH AND GIT CLONE (AND GIT REBASE)
Git Pull
From what I understand, git pull will pull down from a remote whatever you ask (so, whatever trunk you’re asking for) and instantly merge it into the branch you’re in when you make the request. Pull is a high-level request that runs ‘fetch’ then a ‘merge’ by default, or a rebase with ‘–rebase’. You could do without it, it’s just a convenience.
%> git checkout localBranch
%> git pull origin master
%> git branch
Simple collaborating git flow
Add collaborator on remote settings ( github )
+ setting ( remote repo )
+ Contributor clone rep down
Create branch and cd into it: