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
/* | |
【 マウス+WASDキーによるカメラ操作 】 | |
作成者:watano | |
必ずカメラにアタッチしてください。 | |
Space : 上移動(+y) | |
Shift : 下移動(-y) | |
W : 前移動(+z) | |
S : 後移動(-z) | |
A : 左移動(-x) |
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
#!/bin/bash | |
if [ "x$1" = "x" -o "x$2" = "x" ]; then | |
echo Usage: `basename "$0"` "<input.pdf>" "<output.pdf>" >&2 | |
exit 1 | |
fi | |
# change 'ps2write' to 'pswrite' if errors | |
gs -sDEVICE=ps2write -dNOCACHE -sOutputFile=- -q -dbatch \ | |
-dNOPAUSE -dQUIET "$1" -c quit | ps2pdf - "$2" |
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
var block_id = 0; | |
var scale = 10; | |
var density = 10; | |
function f (x) { | |
return Math.pow(x, 3); | |
}; | |
var prefab_ids = []; |
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
import itertools | |
from PIL import Image | |
#def mandel(z, c): | |
# return z ** 2 + c | |
result = Image.new("L", (400, 400)) | |
for r, i in itertools.product(xrange(400), repeat=2): |
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
[ | |
true, | |
false, | |
'true', | |
'True', | |
'TRUE', | |
'false', | |
'False', | |
'FALSE', | |
null, |
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
# -*- encoding: utf-8 -*- | |
require 'rubygems' | |
require 'tweetstream' | |
require 'twitter' | |
require 'mysql2' | |
require './key.rb' | |
Twitter.configure do |config| | |
config.consumer_key = Const::CONSUMER_KEY | |
config.consumer_secret = Const::CONSUMER_SECRET |
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
# -*- encoding: utf-8 -*- | |
require 'twitter' | |
class UpdateString < String | |
def delete_account_name(sasamljp) | |
self.sub("(#{sasamljp})",'') | |
end | |
def delete_at_mark | |
self.gsub(/(@|@)/,'') |
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
var ntwitter = require('ntwitter'); | |
var twi = new ntwitter({ | |
'consumer_key': '', | |
'consumer_secret': '', | |
'access_token_key': '', | |
'access_token_secret': '' | |
}); | |
var my_screen_name = ''; |
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' | |
require 'levenshtein' | |
require 'shellwords' | |
def similar(s1, s2, threshold = 2) | |
d = Levenshtein.distance(toKatakana(s1), toKatakana(s2)) | |
d <= threshold | |
end | |
def toKatakana(str) |
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
# -*- encoding: utf-8 -*- | |
require 'rubygems' | |
require 'twitter' | |
class Integer | |
def prime? | |
n = self.abs() | |
return true if n == 2 | |
return false if n == 1 || n & 1 == 0 | |
d = n-1 |
NewerOlder