Skip to content

Instantly share code, notes, and snippets.

@snaka
snaka / nicolive.rb
Created January 23, 2010 07:27
ニコ生アラートを受信するスクリプト
require 'net/http'
require 'rubygems'
require 'nokogiri'
KCODE = 'UTF-8'
# アラートを通知してくれるコメントサーバーの情報を取得
response = Net::HTTP.get(URI('http://live.nicovideo.jp/api/getalertinfo'))
xml = Nokogiri(response)
address = (xml/'addr').inner_text()
<?php
// OpenSocial RESTful APIサンプル (2-legged OAuth)
// ライブラリとして http://oauth.googlecode.com/svn/code/php/ を利用しています。
include_once('lib/OAuth.php');
define('CONSUMER_KEY', '#CONSUMER_KEY#');
define('CONSUMER_SECRET', '#CONSUMER_SECRET#');
define('BASE_URL', '#BASE_URL#');
#/usr/bin/python
#-*- encoding:utf-8 -*-
#====== options =============
#Oauth用認証トークン 各自取得
ckey = ""
csecret = ""
atoken =""
atoken_secret = ""
#============================
class QuickOutputter(object):
def __lt__(self, msg):
print msg
return self
o = QuickOutputter()
o < "Some random message"
o < "Some other message"
@youzaka
youzaka / gist:985485
Created May 22, 2011 13:54
TSファイルから記述子を取得
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
from array import array
from collections import defaultdict
from datetime import datetime, time
from StringIO import StringIO
import sys
@co3k
co3k / co3k.asc
Created November 26, 2011 09:09
GPG Publick Key of "Kousuke Ebihara <kousuke@co3k.org>"
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
mQENBE6qdy8BCACgK0kZUgjJEIMQ3derJpqaQjSbSYPpjot6exH3+Z/QbaGsBNm3
+mlD+XgFZbX7J8pTlcrpBB9ntKCORuSpF5O3AjB/8FbHy+mcoTKg16JP6qlYRuSF
9PappM7hDzpcI1NiXdckjHRGGtIa6Lxg26zB+2hQPjF0PjAPqojFZOTmTk4fEaqb
tvjf1XAQRHLn0bejfF5ooRw27WgQDUaweBHghG7CYxWF1zjunkyXeWPrZel7thz1
epfm3mVTlNzH2iBVlQuZBcHmZrJK6EfyfOgO/xk9vcfgzaFztuSn/vW2iqfMEF9G
1MgO9A0+wffmW5UgDREdb7Vw4TopShJge+dHABEBAAG0IktvdXN1a2UgRWJpaGFy
@takeshik
takeshik / brainyacq.yacq
Created December 9, 2011 16:49
Brainf*ck on Yacq
(def bf (\ [c:String] ($ [
d Int32.array.(new 30000) ; data array
di 0 ; data index
ci 0 ; code index
s Stack.[Int32].(new) ; jump stack
jc 0 ; jump counter
]
EnumerableEx.(Repeat c)
.(TakeWhile {!= ci $0.Length})
.(ForEach {$
@co3k
co3k / gist:3016197
Created June 29, 2012 06:18
symfony 1.4.x は *.method_not_found というイベントを用意する時点でこういうのをフレームワークとして用意して欲しかったニャー (ああでもこの手の奴は PHP 5.3.x 前提だから無理ってことですねはい)
<?php
// 想像を形にしてみただけなので動かないかもよ
class sfInjectedMethod
{
protected $method, $callable;
public __construct($method, $callable)
{
diff --git a/OpenTween/Twitter.cs b/OpenTween/Twitter.cs
index 75210fb..0b167e6 100644
--- a/OpenTween/Twitter.cs
+++ b/OpenTween/Twitter.cs
@@ -2240,7 +2240,7 @@ namespace OpenTween
return "";
}
- private string CreatePostsFromSearchJson(string content, TabClass tab, bool read, int count, ref long minimumId)
+ private string CreatePostsFromSearchJson(string content, TabClass tab, bool read, int count, ref long minimumId, bool more)
@co3k
co3k / gist:3903869
Created October 17, 2012 05:36
Git リポジトリ内で ack しようとするとこらーって言うやつ
function ack()
{
if git log -0 &> /dev/null ; then
echo "You are in git repository so you can grep by git-grep command"
else
/usr/local/bin/ack $*
fi
}