Skip to content

Instantly share code, notes, and snippets.

@esehara
esehara / gist:1282809
Created October 12, 2011 22:14
なぞのエラー
{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses,
TemplateHaskell, OverloadedStrings #-}
import Yesod
import Yesod.Auth
import Yesod.Auth.OAuth
import Data.Text.Internal
data HelloWorld = HelloWorld
@esehara
esehara / gist:1289638
Created October 15, 2011 14:27
さーばーさいとじゃばすくりぷと
require.paths.push("/usr/local/lib/node_modules")
express = require "express"
app = express.createServer()
hamljs = require "hamljs"
coffee = require "coffee-script"
io = require("socket.io").listen(app)
io.configure () ->
io.set "transports",["xhr-polling"]
io.set "polling duration",10
@esehara
esehara / gist:1289657
Created October 15, 2011 14:40
くらいあんとがわこっふぃーすくりぷと
@rand = (x,y) ->
Math.floor Math.random() * x + y
log = () ->
console.log arguments
target = $("<div></div>").text arguments[0][0]
target.css "display":"None","position":"absolute","top":arguments[0][2],"left":arguments[0][1],"font-size":arguments[0][3]
$("body").append target
target.append('<embed src="' + arguments[0][4] + '" autostart="true" hidden="true" loop="false">')
target.fadeIn(1500).fadeOut 1500,() ->
@esehara
esehara / gist:1303879
Created October 21, 2011 13:43
HTMLF*CK
# -*- coding:utf-8 -*-
##use Module
import ply.lex as lex
import ply.yacc as yacc
#Use Token
tokens = (
'STRING'
,'P_Start'
,'P_End'
@esehara
esehara / gist:1305959
Created October 22, 2011 12:42
Pynoise
# -*- coding:utf-8 -*-
import threading
import time
import pyaudio
import math
import array
import random
class System(threading.Thread):
def __init__(self,channels,pine = 3.14):
@esehara
esehara / gist:1319694
Created October 27, 2011 14:30
SHPAML -> HTML -> PDF -> NetPrint
# -*- coding:utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
import sys
import os
import shpaml
import BeautifulSoup
import mechanize
@esehara
esehara / gist:1325133
Created October 29, 2011 21:45
Life Music (Life Game like Music Composer)
# -*- coding:utf-8 -*-
import pygame
from pygame.locals import *
import pygame.mixer
import sys
import copy
import array
sounds = [0 for j in range(0,20)]
cell = [[0 for j in range(0,20)] for i in range(0,20)]
@esehara
esehara / gist:1327644
Created October 31, 2011 14:48
Project Euler (Japanese Translation) -> Epub
# -*- coding: utf-8 -*-
import os
import urllib2
import BeautifulSoup
import re
import zipfile
class Epub_maker(object):
def __init__(self,filename,title,author,identi,workspace='./temp/',):
"""
Initialize :: Create Directory and File.Epub needs there.
@esehara
esehara / gist:1330542
Created November 1, 2011 13:53
Gmail -> Eject CD
import imaplib
import pygame
def cd_eject():
pygame.cdrom.init()
cd = pygame.cdrom.CD(0)
cd.init()
cd.eject()
def mail_check(user,passw):
@esehara
esehara / gist:1339219
Created November 4, 2011 12:24
SlashReading
$ ->
@flash_start = null
pages = {
text: [],
counter: 0,
}
pages.next = () ->
if pages.text.length > @counter
@counter = @counter + 1