Skip to content

Instantly share code, notes, and snippets.

View bgnori's full-sized avatar

Noriyuki Hosaka bgnori

  • Itabashi, Tokyo, Japan
View GitHub Profile
@bgnori
bgnori / basic-tumbler.xsl
Created December 13, 2011 13:06 — forked from MrBlank/basic-tumbler.xsl
Symphony - Basic Tumbler.com API Utility
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Name: Basic Tumbler.com API Utility
Version: 1.1
Author: Josh Nichols <[email protected]>
URL: http://www.joshnichols.com/
Description:
This utility transforms a basic Tumblr.com XML source into XHTML. Each post is grouped by date and is marked up in a way that allows for easy styling with CSS.
@bgnori
bgnori / Spiral.py
Created December 28, 2011 01:15
ウラムの螺旋
#!/usr/bin/python
# -*- coding utf8 -*-
def isPrime(n):
if n == 1:
return False
elif n == 2:
return True
# -*- coding: utf-8 -*-
module Termtter::Client
register_macro(:chihirow, "update %s もう生きるのが疲れました。",
:help => ['chihirow {SCREENNAME}', 'update "@{SCREENNAME} もう生きるのが疲れました。"']
)
end
module Termtter::Client
register_macro(:chihirow, "update @%s もう生きるのが疲れました。",
module Termtter::Client
register_command(
:name => :tmark,
:help => ['tmark msg', 'marking tweet for tumblr chat(conversation) post'],
:exec => lambda {|arg|
p 'tuml', arg
}
)
end
require 'set'
$marked = Set.new []
module Termtter::Client
register_command(
:name => :tmark,
:help => ['tmark msg', 'marking tweet for tumblr chat(conversation) post'],
:exec => lambda {|arg|
$marked.add(arg)
@bgnori
bgnori / ichyweed.rb
Created April 17, 2012 05:33
itchy weed, termtter plugin. markしたtweetをtumblrにchatとしてpostする。
# -*- coding: utf-8 -*-
# author: bgnori [email protected], @bgnori(twitter), bgnori.tumblr.com
#
# Thanks to tumblife!(mitukiii)
#
# http://kagit.tumblr.com/post/20218426153
# 人のなにげないツイート、タンブラーにポストするのキモいですよ
# Twitter /@honishi
#
#
@bgnori
bgnori / main.py
Created April 17, 2012 09:51
manhole sample.
#
# from http://hinoglu.blogspot.jp/2009/08/code-completion-in-twisted-manhole.html
# added import string.
#
import string
from twisted.internet import reactor
from twisted.cred import portal, checkers
@bgnori
bgnori / birthday.py
Created April 24, 2012 14:59
birthday collision in twitter, with 500 followers.
import random
def experiment():
bds = {}
for n in range(500):
bd = random.randint(1, 365)
bds[bd] = bds.get(bd, 0) + 1
result = {}
for i in range(1, 366):
helloworld: bf2c.o helloworld.o
gcc -o helloworld bf2c.o helloworld.o
bf2c.o: bf2c.c
gcc -c bf2c.c
helloworld.o: helloworld.c
gcc -c helloworld.c
[nori@akagi]~/Desktop/work/cloft/cloft% git diff fc57adc48b1e7b44f8371dae47365d96c8705c99
diff --git a/src/cloft/core.clj b/src/cloft/core.clj
index 3bd0a13..db68730 100644
--- a/src/cloft/core.clj
+++ b/src/cloft/core.clj
@@ -487,10 +487,15 @@
(defn player-interact-entity-event [evt]
(let [target (.getRightClicked evt)]
- (letfn [(d [n]