Skip to content

Instantly share code, notes, and snippets.

View kaosf's full-sized avatar
🏠
Working from home

ka kaosf

🏠
Working from home
View GitHub Profile
@kaosf
kaosf / ls.d
Created April 11, 2012 15:57 — forked from noqisofon/ls.d
execute "ls" command with D language (D 言語で ls コマンド実行)
// tested with DMD64 D Compiler v2.058
import std.process;
void main() {
system( "ls" );
}
@kaosf
kaosf / clockwork-init.sh
Created June 23, 2012 01:28 — forked from tomykaira/clockwork-init.sh
Create a new project with clockwork for heroku.
#!/bin/sh
# Licence: MIT
# Created by tomykaira, 2011-10-25
if [ $# -ne 1 ]; then
echo "Give me your new project name (only)"
exit 1
fi
!!! 5
//if lt IE 7
<html class="no-js lt-ie9 lt-ie8 lt-ie7">
//if IE 7
<html class="no-js lt-ie9 lt-ie8">
//if IE 8
<html class="no-js lt-ie9">
//[if gt IE 8]><!
html(class='no-js')
//<![endif]
@kaosf
kaosf / favstar.rb
Created April 2, 2014 06:54 — forked from siyo/favstar.rb
0
Earthquake.init do
command %r|^:favstar\s*(.+)*|, :as => :favstar do |m|
browse 'http://favstar.fm/me'
end
end
@kaosf
kaosf / fork_with_new_connection.rb
Last active May 19, 2022 07:23 — forked from danieldbower/fork_with_new_connection.rb
Forking Processes In Ruby On Rails
# Logic for forking connections
# The forked process does not have access to static vars as far as I can discern, so I've done some stuff to check if the op threw an exception.
def fork_with_new_connection
# Store the ActiveRecord connection information
config = ActiveRecord::Base.remove_connection
pid = fork do
# tracking if the op failed for the Process exit
success = true