Skip to content

Instantly share code, notes, and snippets.

var assert = require('assert');
var helpers = {
view: function() {
return "viewing: " + this.msg;
}
}
// jade
// "h1= view()"
// compiled jade
brew update
brew tap homebrew/dupes
brew install apple-gcc42
export CC=gcc-4.2
curl https://gist.github.com/rorcraft/8815129/raw/f184726d7dd8d306d6f63acd97c39bb8ea6dbb84/jamesgolick-ruby > ~/.rbenv/plugins/ruby-build/share/jamesgolick
rbenv install jamesgolick
@rorcraft
rorcraft / gulp-cwebp.js
Last active August 29, 2015 13:57
gulp plugin for cwebp, doesn't require imagemagick.
var through = require('through2')
, gutil = require('gulp-util')
function cwebp() {
var Webp = require('cwebp')
, File = require('vinyl')
return through.obj(function (file, enc, cb) {
this.push(file)
if (file.isBuffer()) {
@rorcraft
rorcraft / gist:11407295
Created April 29, 2014 17:48
node module structure
// 1. bind every function
function foo(locale) {
return locale + '-foo';
}
module.exports = function helper(locale) {
return {
foo: foo.bind(null, locale)
}
@rorcraft
rorcraft / .slate
Created June 26, 2014 18:19
Slate config
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
bind right:alt;ctrl resize +10% +0
bind left:alt;ctrl resize -10% +0
class BaseCodec
def self.base_n_decode(s, alphabets)
n = alphabets.length
rv = pos = 0
charlist = s.split("").reverse
charlist.each do |char|
rv += alphabets.index(char) * n ** pos
pos += 1
end
return rv
require "rubygems"
require "hmac-sha1"
require "base64"
ankoder_access_key = ANKODER_ACCESS_KEY
private_key = ANKODER_PRIVATE_KEY
ankoder_date = Time.now.strftime("%a, %d %b %Y %X GMT")
ankoder_action = "GET"
ankoder_path = "/video.xml"
string = "-#{ankoder_date}-#{ankoder_action}-#{ankoder_path}-"
require "rubygems"
require "hmac-sha1"
require "base64"
ankoder_access_key = ANKODER_ACCESS_KEY
private_key = ANKODER_PRIVATE_KEY
ankoder_date = Time.now.strftime("%a, %d %b %Y %X GMT")
ankoder_action = "GET"
ankoder_path = "/video.xml"
string = "-#{ankoder_date}-#{ankoder_action}-#{ankoder_path}-"
require "rubygems"
require "hmac-sha1"
require "base64"
ankoder_access_key = ANKODER_ACCESS_KEY
private_key = ANKODER_PRIVATE_KEY
ankoder_date = Time.now.strftime("%a, %d %b %Y %X GMT")
ankoder_action = "GET"
ankoder_path = "/video.xml"
string = "-#{ankoder_date}-#{ankoder_action}-#{ankoder_path}-"
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 4,
interval: 6000,
width: 'auto',
height: 300,
theme: {