Skip to content

Instantly share code, notes, and snippets.

@nicklegr
nicklegr / disc-station-playlist.txt
Created April 16, 2012 14:35
DiscStation playlist
RUDE BREAKER - Stage 3
Push'n Pop - Last Battle
あっぷるそーす あのコと夏祭り - メインテーマ
あっぷるそーす 丁稚っち - ALESTER_BURN Pleiades
究極変幻バトルギャルさおり - バトル
究極変幻バトルギャルさおり - ラストバトル
幻世快盗伝 - 街
大魔導戦略物語95 - ラストステージ
@nicklegr
nicklegr / bear.coffee
Created April 21, 2012 02:19
enchant.js bear sample in CoffeeScript
enchant()
window.onload = () ->
game = new Game(320, 320)
game.fps = 24
game.preload('chara1.gif')
# The images used in the game should be preloaded
game.onload = () ->
bear = new Sprite(32, 32);
@nicklegr
nicklegr / uh_nyah.coffee
Created April 21, 2012 10:09
enchant.js haiyoru_something
enchant()
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
class UhNyah extends Game
constructor: () ->
super(SCREEN_WIDTH, SCREEN_HEIGHT)
@enemies = []
@nicklegr
nicklegr / gcj-ruby-tmpl.rb
Created April 27, 2012 11:32
GCJ ruby template
require 'pp'
# http://0xcc.net/ruby-bsearch/index.html.ja
# require './bsearch'
# https://github.com/kanwei/algorithms
# require 'rubygems'
# require 'algorithms'
# include Containers
@nicklegr
nicklegr / gcj-bash-aliases.sh
Created April 27, 2012 11:34
GCJ bash aliases
function sakura {
cygstart /d/Program\ Files/sakura/sakura.exe `cygpath -m $@`
}
# 問題とサンプルデータを生成し、開く。
# usage: go A
function go() {
problem=$1
source=$problem.rb
data=$problem-sample.in
@nicklegr
nicklegr / A.rb
Created May 1, 2012 03:40
GCJ 2012 Round 1A - A. Password Problem
require 'pp'
# http://0xcc.net/ruby-bsearch/index.html.ja
# require './bsearch'
# https://github.com/kanwei/algorithms
# require 'rubygems'
# require 'algorithms'
# include Containers
@nicklegr
nicklegr / B.rb
Created May 1, 2012 03:49
GCJ 2012 Round 1A - B. Kingdom Rush
require 'pp'
# http://0xcc.net/ruby-bsearch/index.html.ja
# require './bsearch'
# https://github.com/kanwei/algorithms
# require 'rubygems'
# require 'algorithms'
# include Containers
@nicklegr
nicklegr / short_url.rb
Created May 8, 2012 14:10
Rubyで、さまざまなサービスの短縮URLを展開する
#!ruby -Ku
require 'net/http'
require 'uri'
require 'json'
require 'pp'
class ShortURL
# 普通のURLを渡した場合、そのまま返す
def self.expand(short_url)
@nicklegr
nicklegr / gist:3929444
Created October 22, 2012 03:10
Twitter公式クライアントのコンシューマキー

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@nicklegr
nicklegr / gist:5737713
Created June 9, 2013 04:57
ExecJS::RuntimeError - SyntaxError: octal literal '06' must be prefixed with '0o' on line 34:
html = '''
<table class="table">
<tr>
<td>
<a href='https://twitter.com/TwitAA_bot'>
TwitAA_bot
</a>
</td>