Skip to content

Instantly share code, notes, and snippets.

View ricokareem's full-sized avatar
:octocat:

Rico Rodriquez Collins ricokareem

:octocat:
View GitHub Profile
@wookimiii
wookimiii / grco.bash
Last active September 15, 2021 22:06
Check out a branch using grep
#!/bin/bash
BRANCHES=$(git branch -ra | grep $1)
NUM=$(echo "$BRANCHES" | wc -l)
# check for empty
if [ "X$BRANCHES" = "X" ]
then
echo "No branch matches $1"
fi
@mattpodwysocki
mattpodwysocki / quicksort.js
Last active July 15, 2017 17:57
Implementation of QuickSort using ES6 features
// Using comprehensions
function sort(arr) {
var pivot, t;
if (arr.length === 0) {
return [];
}
[pivot, t] = [arr[0], arr.slice(1)];
return sort([x for (x of t) if x < pivot])
.concat(pivot)
.concat(sort([x for (x of t) if x >= pivot]));
" for use before a colorscheme definition
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
" for use when not using a colorscheme
" highlight ExtraWhitespace ctermbg=red guibg=red
" show unwanted whitespace
match ExtraWhitespace /\s\+\%#\@<!$/
" strip unwanted trailing whitespace on save
@ryanflorence
ryanflorence / cs-iife.coffee
Created September 29, 2011 19:10
CoffeeScript Immediately Invoked Function Expressions
increment = do ->
x = 0
->
x++
@olivierlacan
olivierlacan / launch_sublime_from_terminal.markdown
Created September 5, 2011 15:50
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@clintel
clintel / gist:1155906
Created August 19, 2011 02:40
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code