Skip to content

Instantly share code, notes, and snippets.

/* 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 =>
@edeustace
edeustace / less_converter.rb
Created August 16, 2012 18:12 — forked from jasongraham/less_converter.rb
A Jekyll plugin to convert a .less file to .css
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"
@edeustace
edeustace / less_converter.rb
Created August 16, 2012 18:12 — forked from jasongraham/less_converter.rb
A Jekyll plugin to convert a .less file to .css
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"
@edeustace
edeustace / static_server.js
Last active December 21, 2015 08:38 — forked from ryanflorence/static_server.js
Server large files with a stream.
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);
#!/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
@edeustace
edeustace / index.js
Created July 8, 2014 12:48 — forked from Matt-Esch/index.js
requirebin sketch
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',
#!/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
@edeustace
edeustace / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# 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'