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
# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh | |
# Aliases | |
alias g='git' | |
#compdef g=git | |
alias gst='git status' | |
#compdef _git gst=git-status | |
alias gd='git diff' | |
#compdef _git gd=git-diff | |
alias gdc='git diff --cached' |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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/bash | |
# Oracle hasn't updated the Java 1.7u65 installer to support Yosemite, | |
# so here's a way to get it installed. | |
# This is actually what I used to get IntelliJ IDEA running, but even | |
# if you aren't running that IDE, this is a quick script to get Java | |
# going strong on your fresh install of OS X 10.10 | |
# Install Java 6 for OS X |
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
var h = require('virtual-dom/h'); | |
var diff = require('virtual-dom/diff'); | |
var patch = require('virtual-dom/patch'); | |
var createElement = require('virtual-dom/create-element'); | |
// 1: Create a function that declares what the DOM should look like | |
function render(count) { | |
return h('div', { | |
style: { | |
textAlign: 'center', |
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
#!/usr/bin/env ruby | |
require "openssl" | |
require 'digest/sha2' | |
require 'base64' | |
# We use the AES 256 bit cipher-block chaining symetric encryption | |
alg = "AES-256-CBC" | |
# We want a 256 bit key symetric key based on some passphrase | |
digest = Digest::SHA256.new |
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
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
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 Jekyll | |
# Compiled LESS CSS into CSS. You must specify an empty YAML front matter | |
# at the beginning of the file. | |
# .less -> .css | |
class LessConverter < Converter | |
safe true | |
priority :low | |
pygments_prefix "\n" | |
pygments_suffix "\n" |
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 Jekyll | |
# Compiled LESS CSS into CSS. You must specify an empty YAML front matter | |
# at the beginning of the file. | |
# .less -> .css | |
class LessConverter < Converter | |
safe true | |
priority :low | |
pygments_prefix "\n" | |
pygments_suffix "\n" |
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
/* http://tbje.blogspot.com/2010/04/random-unique-hash-in-scala.html */ | |
import scala.util.Random | |
def uniqueRandomKey(chars: String, | |
length: Int, | |
uniqueFunc: String=>Boolean) : String = | |
{ | |
val newKey = (1 to length).map( | |
x => |