This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run git status if in git repo, else ls -la | |
function cs { | |
clear | |
if ! git ls-files >& /dev/null | |
then | |
ls -la | |
else | |
git status | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Brainfuck (http://en.wikipedia.org/wiki/Brainfuck) is an strange language noted for its extreme simplicity - programs are written using 7 commands in total, and executed sequentially. | |
An 'instruction pointer' starts at the first command, executes it, and normally moves forward to the next command (with one exception). | |
The program terminates when the instruction pointer moves past the last command. | |
For those familiar with Turing machines, this is a very similar concept. We'll have a 'tape' of cells holding our values, a pointer to the current cell, and an instruction pointer looping through the program. | |
The commands we'll be working with are as follows (here, 'pointer' refers to the current cell pointer): | |
> Move the cell pointer to the cell on the right | |
< Move the cell pointer to the cell on the left |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Pre-push hook to prevent pushes to master branch. | |
pushed_branch=`git rev-parse --abbrev-ref HEAD` | |
if [[ "$pushed_branch" == "master" ]] | |
then | |
echo "[Notice] Pre-push hook preventing push to master. Create a feature branch instead." | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module A | |
def do_something | |
puts 'A->do_something' | |
super | |
end | |
end | |
module B | |
def do_something | |
puts 'B->do_something' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cassandra | |
alias :old_insert :insert | |
def insert(column_family, key, hash, options = {}) | |
puts "Injected! Send AMQP notification here..." | |
old_insert(column_family, key, hash, options) | |
end | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tracerColors = [ | |
'#1B184F', | |
'#312c91', | |
'#423ac0', | |
'#9c4274' | |
] | |
class Tracer extends Kona.Entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bash Command Visualization</title> | |
<style type="text/css"> | |
* { margin: 0; padding: 0; } | |
#chart { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>D3 Page Template</title> | |
<style> | |
* { margin: 0; padding: 0; } | |
body { padding: 30px; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JSON structure: | |
{ | |
"countries" : [ | |
{ "name": "CountryName", "alternatives": "One Two" }, | |
{ ... } | |
] | |
} | |
NewerOlder