Skip to content

Instantly share code, notes, and snippets.

View cgrinaldi's full-sized avatar

Chris Rinaldi cgrinaldi

View GitHub Profile
@cgrinaldi
cgrinaldi / func-expr-hoisting-I.js
Created March 27, 2015 00:18
A simple example of hoisting with function expressions
var myNumber = 2;
console.log(myNumber);
@cgrinaldi
cgrinaldi / func-decl-example.js
Last active August 29, 2015 14:17
Simple function examples showing function expressions vs. function declarations
// simple example of a function declaration
function double (number) {
var result = 2 * number;
return result;
}

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@cgrinaldi
cgrinaldi / autoPullSoln.sh
Last active August 29, 2015 14:16
Automate the process of creating a solution branch and pulling from remote repository
#!/bin/bash
localPATH=`pwd` # path of current directory
sep='---------------'
for d in */; do
echo $sep"Processing" $d$sep
d=`echo $d | sed s#/##` # remove trailing forward slash
remoteRepo="https://github.com/hackreactor/$d.git" # location of remote repo
git -C $localPATH/$d remote add upstream $remoteRepo # add remote repo as upstream
git -C $localPATH/$d checkout master # checkout master branch in current $d
firstCommit=`git -C $localPATH/$d rev-list HEAD | tail -n 1` # identify the first commit in master
@cgrinaldi
cgrinaldi / autoStatus.sh
Last active September 18, 2015 10:08
Check the statuses of multiple git repositories within a shared directory structure
#!/bin/bash
localPATH=`pwd` # path of current directory
sep='---------------'
for d in */; do
echo $sep"Checking Status of" $d$sep
d=`echo $d | sed s#/##` # remove trailing forward slash
git -C $localPATH/$d checkout master # checkout master in different directory
git -C $localPATH/$d status # run git status
echo -e '\n'
done