Skip to content

Instantly share code, notes, and snippets.

View gyuque's full-sized avatar

Ueyama Satoshi gyuque

View GitHub Profile
@gyuque
gyuque / gist:627854
Created October 15, 2010 08:34
draw.rb
require 'rubygems'
require 'json'
require 'cairo'
require 'uri'
format = Cairo::FORMAT_RGB24
width = 1200
height = 1600
def draw_rects(g, ls)
@gyuque
gyuque / gist:627852
Created October 15, 2010 08:33
repl.rb
require 'rubygems'
require 'json'
require 'net/telnet'
target_url = "http://www.jewelpet.jp/"
prompt = /^repl> /
INJECT_JS = <<EOS
repl.print( (function(doc){
var _j = function(s) {
@-moz-document url-prefix("http://www.youtube.com") {
.homepage-side-block,.ad-div {
display: none !important;
}
#logo {
width: 184px !important;
height: 35px !important;
background: url(http://26.media.tumblr.com/tumblr_laadpmENYK1qz5devo1_250.png) top left !important;
}
@gyuque
gyuque / gist:589379
Created September 21, 2010 08:13 — forked from shozaikun/gist:589321
・・・・・・・・
・・・・・・・・
・・・●・・・・
・・・●◯◯・・
・・・●◯◯・・
・・・・・◯・・
・・・・・・・・
・・・・・・・・
gyuque> チャット機能すごい
@gyuque
gyuque / gist:589319
Created September 21, 2010 07:08 — forked from ssig33/gist:589318
・・・・・・・・
・・・・・・・・
・・・・・・・・
・・・◯◯◯・・
・・・●◯・・・
・・・・・・・・
・・・・・・・・
・・・・・・・・
gyuque> チャット機能すごい
・・・・・・・・
・・・・・・・・
・・・・・・・・
・・・◯●・・・
・・・●◯・・・
・・・・・・・・
・・・・・・・・
・・・・・・・・
package canvas
import "image"
func minmax(a, b int) (min, max int, reversed bool) {
if a < b {
min = a;
max = b;
reversed = false;
} else {
max = a;
package main
import ("./canvas";
"os";
"math";
"syscall";
"image/png";
"fmt";
)
func main() {
# coding: utf-8
import re
import os
import cgi
import sys
import google.appengine.api.users
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template
# -*- coding: utf-8 -*-
import re
class ParseTwneruText(object):
sleeps = u'寝る 就寝 ねる 寝た ねた'.split()
wakes = u'起きた 起床 おきた'.split()
time = re.compile(u'([0-9]{1,2})[:時]([0-9]{1,2})')
date = re.compile(u'([1-9][0-9]?)日')