Skip to content

Instantly share code, notes, and snippets.

@savage69kr
savage69kr / 0-readme.md
Created October 27, 2012 07:16 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

Overview

This script installs a patched version of ruby 1.9.3-p194 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches.

http://fladdict.net/blog/2011/02/auto-kerning.html
グローバル汚染を無くしたのと、jQueryらしくかけるようにしました。
// 引数なしの場合デフォルトのカーニングが摘要される。
$(selector).FLAutoKerning();
// 引数を入れた場合、そのカーニングが摘要される。
$(selector).FLAutoKerning(myKerningInfo);
ライセンスは元のFLAutoKerning.jsを継承します。
@savage69kr
savage69kr / MultiGetSet.js
Created November 12, 2012 13:27 — forked from melanke/MultiGetSet.js
MultiGetSet.JS - Quickly generate getters and setters for multiple attributes
var MultiGetSet = function(opt){
var getType = function(o) {
return ({}).toString.call(o).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
};
if(!opt.public || !opt.private)
return opt.public;
if(opt.handler && opt.handler.init)
/*
Implements different bin packer algorithms that use the MAXRECTS data structure.
See http://clb.demon.fi/projects/even-more-rectangle-bin-packing
Author: Jukka Jylänki
- Original
Author: Claus Wahlers
- Ported to ActionScript3
@savage69kr
savage69kr / gfm.php
Created December 17, 2012 12:51 — forked from koenpunt/gfm.php
<?php
function gfm($text){
# Extract pre blocks
$extractions = array();
$text = preg_replace_callback('/<pre>.*?<\/pre>/s', function($matches) use (&$extractions){
$match = $matches[0];
$md5 = md5($match);
$extractions[$md5] = $match;
@savage69kr
savage69kr / gfm.rb
Created December 17, 2012 12:52 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end
crypto = require 'crypto'
gfm = (text) ->
# Extract pre blocks
extractions = {}
text = text.replace /<pre>(\n|.)*?<\/pre>/gm, (match) ->
md5 = crypto.createHash('md5').update(match).digest('hex')
extractions[md5] = match
'{gfm-extraction-' + md5 + '}'
/**
* Haskell Brushe for SyntaxHighlighter 3.0
*/
SyntaxHighlighter.brushes.Haskell = function()
{
var constants = 'True False Nothing Just Left Right LT EQ GT';
var datatypes = 'Bool Maybe Either Ordering Char String Int Integer Float Double Rational ' +
'IO ReadS ShowS FilePath IOError Monad Functor Show Read' +
'Eq Ord Enum Bounded Num Real Integral Fractional Floating RealFrac RealFloat';
<!-- NativeClient hxcpp toolchain -->
<xml>
<include name="gcc-toolchain.xml"/>
<path name="${NACL_SDK_ROOT}/toolchain/linux_x86_newlib/bin"/>
<set name="M" value="32" unless="HXCPP_M64" />
package ;
abstract JsonMap<T>({ }) {
public function exists(key:String) return Reflect.hasField(this, key);
public function get(key:String) return Reflect.field(this, key);
public function set(key:String, value:T) Reflect.setField(this, key, value);
public function keys():Array<String> return Reflect.fields(this);
public function remove(key:String) return Reflect.deleteField(this, key);
public function iterator():Iterator<T> {
var i = 0,