This file contains 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
let bin = System.IO.File.ReadAllBytes "../../test" | |
let mutable i = 0 | |
let show len asm = | |
printf "%08X " i | |
for j = 0 to len - 1 do | |
printf "%02X" bin.[i + j] | |
for j = len to 5 do | |
printf " " | |
printfn "%s" asm | |
i <- i + len |
This file contains 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
/** | |
@license WTFPL | |
@author @sou | |
This library dispatches touch events from an element to another on the different document through iframe. | |
NOTE: | |
This library only suports Mobile Safari as each browsers have different specifications for touch event creation. | |
You might expand _dispatch method if you want to deal with other browsers. |
This file contains 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 ruby | |
#'$_ = $_.match(/^([A-Z][a-z]+)\s+([0-9]+)/) ? "#{$1}_#{$2}\n" : ""' head.log > date.log | |
class FileSplitter | |
attr_accessor :read_from, :logdir | |
def initialize(args) | |
@read_from, @logdir = args | |
@cur_m, @cur_d, @f = nil |
This file contains 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 ruby | |
path, from, to = $* | |
unless path && from && to | |
puts <<-__DESCRIPTION__ | |
./echo_between.rb file_path "from" "to" | |
snips large text file | |
command starts to print lines when matched "from" |
This file contains 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 ruby | |
require 'webrick' | |
require 'optparse' | |
include WEBrick | |
OPTIONS = { | |
# :BindingAddress => '0.0.0.0', | |
:Port => 3000, |
This file contains 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
require 'rubygems' | |
class Trac | |
def initialize(url) | |
@url = url | |
end | |
def newticket | |
@url + '/newticket' | |
end |
This file contains 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
function not_empty(expr, msg) { | |
ok(function() { | |
if (! expr) { | |
return false; | |
} | |
// has length | |
else if (typeof expr['length'] == 'number') { | |
return expr.length > 0; | |
} | |
else { |
This file contains 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
// ==UserScript== | |
// @name ShowHatenaBookmarkComment | |
// @namespace userjs.phphp.net | |
// @description build hatena bookmark comments | |
// @include http://* | |
// ==/UserScript== | |
/* Original Script: Hatena Bookmark Comments Viewer | |
* <http://www.ne.jp/asahi/nanto/moon/> | |
* <http://worris.sakura.ne.jp/hbcview.html> |
This file contains 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
ps -xc|grep -sqi firefox && osascript <<'APPLESCRIPT' | |
tell application "Firefox" to activate | |
tell application "System Events" | |
if UI elements enabled then | |
keystroke "r" using command down | |
-- Fails if System Preferences > Universal access > "Enable access for assistive devices" is not on | |
else | |
-- Fails if Firefox is set to open URLs from external apps in new tabs. | |
-- tell app "Firefox" to Get URL "JavaScript:window.location.reload();" inside window 1 | |
tell application "Firefox" to get URL "JavaScript:window.location.reload();" |
This file contains 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
<?php | |
/** | |
* #test prepare for the test | |
* <code> | |
* class User {}; | |
* function setup() { | |
* MockObject::setFixturePath(sfConfig::get('sf_test_dir') .'/fixtures/test_mock_object.yml', true); | |
* } | |
* | |
* </code> |
OlderNewer