This file contains hidden or 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
# see how well you are doing localizing your site by flipping all localized text upside-down! | |
# anything being loaded from your en.yml will now be quite obvious! | |
if ENV['REVERSE'] | |
module I18n::Backend::Base | |
def flip(c) | |
case c | |
when "a" then return "\u0250" | |
when "b" then return "q" | |
when "c" then return "\u0254" |
This file contains hidden or 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> | |
<head> | |
<script src="http://zeptojs.com/zepto.js" type="text/javascript"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.2/bacon.js" type="text/javascript"></script> | |
<style> | |
html, body { | |
height: 100%; | |
width: 100%; |
This file contains hidden or 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 ProcessLock | |
def initialize(filename) | |
FileUtils.touch(@filename = filename) | |
end | |
def acquire! | |
File.open(@filename, 'r+') do |f| | |
lock(f, false) do | |
f.truncate(f.write(Process.pid)) |
This file contains hidden or 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
String.format = function format() | |
{ | |
var replacements = arguments; | |
return arguments[0].replace(/\{(\d+)\}/gm, function replace(string, match) { | |
return replacements[parseInt(match) + 1]; | |
}); | |
}; |
This file contains hidden or 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 python | |
import json | |
import requests | |
import json | |
import commands | |
import pipes | |
import sys | |
import glob | |
import os |
This file contains hidden or 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
import __builtin__ | |
import operator | |
def merge(a, b): | |
a = a.copy() | |
a.update(b) | |
return a | |
class curry(object): | |
def __init__(self, fn, *args, **kwargs): |
This file contains hidden or 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
import xml.dom.minidom as xml | |
class Document(object): | |
""" | |
XML Document Builder | |
@author Simon Engledew | |
example: | |
dom = Document.catalog(version="1.0") |
This file contains hidden or 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
public static class BubbleBabble | |
{ | |
private static readonly string vowels = "aeiouy"; | |
private static readonly string consonants = "bcdfghklmnprstvzx"; | |
public static string Convert(byte[] bytes) | |
{ | |
int seed = 1; | |
int rounds = 1 + bytes.Length / 2; | |
StringBuilder result = new StringBuilder(); |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Diagnostics; | |
using System.Threading; | |
namespace Ladybear | |
{ | |
/// <summary> | |
/// Dispatches to an Action based on the first generic type parameter. |
This file contains hidden or 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
# config/environment.rb => require 'xmlrpc/client' | |
#XMLRPC::Config.const_set(:ENABLE_NIL_CREATE, true) | |
XMLRPC::Config.const_set(:ENABLE_NIL_PARSER, true) unless XMLRPC::Config.const_defined?(:ENABLE_NIL_PARSER) | |
module XmlRpc | |
class Api | |
class << self | |
def method_missing(method, *args) |