For making your own jittergrams
Two files as input:
./jitter.sh file_01.jpg file_02.jpg
module A | |
# prefer when there are less than three class methods | |
# and there are instance methods | |
def self.boo | |
end | |
def self.soo | |
end | |
def fuuu |
# -*- coding: utf-8 -*- | |
import re | |
import socket | |
class UnsupportedQuery(BaseException): | |
pass |
# eval with method definition is used to prevent warnings in some situations | |
DEFINEE = <<-CODE | |
eval 'def __; end' | |
it = method(:__).owner rescue instance_method(:__).owner | |
eval 'undef __' | |
it | |
CODE | |
self # => main |
#!/usr/bin/env ruby | |
require 'epath' | |
bom = "\xEF\xBB\xBF".force_encoding('binary') | |
Path.glob('**/*.rb') do |file| | |
next if file.binread(3) == bom | |
previous = file.binread | |
file.write bom + previous | |
end |
# "python-like" import | |
load path, true # => will load new constants and methods under anonymous module | |
Module.nesting.first # => inside loaded file will return the current namespace | |
### | |
module PythonImport | |
def import(path) | |
load 'importer.rb', true |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
class @SortableTable | |
constructor: (table, options) -> | |
@table = $(table).children('tbody') | |
@columnSelector = options.columnSelector || 'th' | |
@iconSelector = options.iconSelector | |
@rowMapper = options.rowMapper | |
@afterSort = options.afterSort | |
@enable() | |
getColumn: (element) -> |
require 'benchmark' | |
module Capistrano::Benchmark | |
def self.included(base) | |
base.class_eval do | |
alias execute_task_without_benchmark execute_task | |
alias execute_task execute_task_with_benchmark | |
end | |
end |
module Lock | |
extend self | |
delegate :connection, :to => ActiveRecord::Base | |
def sync(*args) | |
lock = Zlib.crc32 args.join | |
obtain lock | |
yield | |
ensure | |
release lock |