View gist:1452427
--- shell.cc.orig 2010-05-14 15:21:28.000000000 -0500 | |
+++ shell.cc 2010-05-14 15:26:54.000000000 -0500 | |
@@ -211,6 +211,13 @@ | |
i += read; | |
} | |
fclose(file); | |
+ | |
+ // allow the first line to be a shebang (by commenting it out). | |
+ if ((chars[0] == '#') && (chars[1] == '!')) { | |
+ chars[0] = '/'; |
View gist:1524830
フォロー中の一覧 | |
http://qiita.com/following_tag_items | |
自分の一覧 | |
http://qiita.com/mime | |
フォロー中のユーザーの一覧 | |
http://qiita.com/following_user_items?latest_item_id=1468 | |
全体の一覧 | |
http://qiita.com/public | |
通知一覧の件数 | |
http://qiita.com/api/notifications/count |
View urldecode.rb
#!/usr/bin/env ruby | |
require 'uri' | |
str = ARGV.join if ARGV.size > 0 | |
str = STDIN.read unless ARGV.size > 0 | |
puts URI.encode(str) |
View file0.txt
function scan_files_in_dir($dir){ | |
$cwd = getcwd(); | |
chdir($dir); | |
$list = scandir("$dir/vendor") ; | |
foreach( $list as $idx=> $dirname){ | |
if( $dirname == "." ){ unset($list[$idx] ); continue; } | |
if( $dirname == ".." ){ unset($list[$idx] ); continue;} | |
if( is_dir($dirname) === true ){ unset($list[$idx] ) ;continue;} | |
$list[$idx] = getcwd()."/".$dirname; | |
}; |
View dirs.php
<?php | |
function scan_dir_in_dir($dir){ | |
$cwd = getcwd(); | |
chdir($dir); | |
$list = scandir("$dir/vendor") ; | |
foreach( $list as $idx=> $dirname){ | |
if( $dirname == "." ){ unset($list[$idx] ); continue; } | |
if( $dirname == ".." ){ unset($list[$idx] ); continue;} | |
if( is_dir($dirname) === false ){ unset($list[$idx] ) ;continue;} | |
$list[$idx] = getcwd()."/".$dirname; |
View fotolife
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'net/http' | |
require 'wsse' | |
require 'base64' | |
$KCODE='u' | |
if ARGV.size < 1 or not ARGV.all?{|e| File.exist? e} then | |
puts "usage: #{__FILE__} 画像ファイル名 | |
ファイル名はタイトルになる。 | |
タイトル指定したいときはファイル名を使えば良い。" |
View mysql2sqlite.rb
#!/usr/bin/env ruby | |
require 'rubygems' | |
if ARGV.size < 1 or not ARGV.all?{|e| File.exist? e} then | |
puts "usage: #{__FILE__} mysql_create_table.sql | |
MySQL の show create table などで出力したファイルを引数に指定する" | |
exit 2 | |
end |
View test.php
require_once('simpletest/autorun.php’); | |
class Sample extends UnitTestCase{ | |
public function test_my_var(){ | |
$this->assertTrue( 1 == "1" ); | |
} | |
} | |
$t = new Sample(); |
View file0.txt
src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"; | |
sc = document.createElement("script"); | |
sc.type="text/javascript"; | |
sc.src=src; | |
document.body.appendChild(sc); |
View yucho_bank.rb
require 'rubygems' | |
require 'kconv' | |
require 'openssl' | |
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE | |
require 'mechanize' | |
class YuchoBank | |
attr_accessor :password, :passphrase_list, :id, :password,:m | |
START_URL ="https://direct.jp-bank.japanpost.jp/direct_login.html?link_id=ycDctLgn" | |
def initialize() |
OlderNewer