Skip to content

Instantly share code, notes, and snippets.

Avatar

Yuya Hasegawa verus

View GitHub Profile
View gist:7799529
// ==UserScript==
// @name My Fancy New Userscript
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://localhost:8080/*
// @copyright 2012+, You
// ==/UserScript==
function onjQueryLoad(onloadCallback){
@verus
verus / easybook.rb
Created Feb 20, 2012
Easybook formula for homebrew
View easybook.rb
require 'formula'
class Easybook < Formula
head 'https://github.com/javiereguiluz/easybook.git', :branch => 'master'
url 'https://github.com/javiereguiluz/easybook/tarball/v4.0.0'
homepage 'http://easybook-project.org/'
md5 'b9f891d3a88f8dd4013aa243c8b0ccb1'
def install
prefix.install Dir['*']
@verus
verus / easybook.rb
Created Feb 20, 2012
Easybook formula for homebrew
View easybook.rb
require 'formula'
class Easybook < Formula
head 'https://github.com/javiereguiluz/easybook.git', :branch => 'master'
url 'https://github.com/javiereguiluz/easybook/tarball/v4.0.0'
homepage 'http://easybook-project.org/'
md5 'b9f891d3a88f8dd4013aa243c8b0ccb1'
def install
prefix.install Dir['*']
View compare.rb
stra = (1..100000).map{ (1..100).map{ rand(255).chr }.join }
strb = (1..100000).map{ (1..100).map{ rand(255).chr }.join }
syma = stra.map{|e| e.to_sym }
symb = strb.map{|e| e.to_sym }
start = Time.now
puts syma == symb
puts Time.now - start
View compare.rb
stra = (1..100000).map{ (1..100).map{ rand(255).chr }.join }
strb = (1..100000).map{ (1..100).map{ rand(255).chr }.join }
syma = stra.map{|e| e.to_sym }
symb = strb.map{|e| e.to_sym }
start = Time.now
puts stra == strb
puts Time.now - start
View compare.rb
arya = (1..100000).map{ rand(1000) }
aryb = (1..100000).map{ rand(1000) }
stra = arya.map{|e| e.to_s }
strb = aryb.map{|e| e.to_s }
syma = stra.map{|e| e.to_sym}
symb = strb.map{|e| e.to_sym}
start = Time.now
View wavelet.rb
def haar l
def aux l, m, n
if l.size == 1
l + n
elsif l.size == 0
aux m, [], n
elsif l.size > 1
aux l[2..-1] , [l[0] + l[1]] + m, [l[0] - l[1]] + n
else
[]
@verus
verus / wavelet.hs
Created Feb 1, 2012
Wavelet transform in Haskell
View wavelet.hs
import System.Environment
haar:: [Int] -> [Int]
haar l = aux l [] []
where aux [s] [] d = s : d
aux [] s d = aux s [] d
aux (h1:h2:t) s d = aux t ((h1 + h2) : s) ((h1 - h2) : d)
aux _ _ _ = []
array = [2, -3]
View mimetex.rb
require 'formula'
class Mimetex < Formula
url 'http://www.forkosh.com/mimetex.zip'
homepage 'http://www.forkosh.com/mimetex.html'
md5 '95400bb0f597760801a0841e7108f242'
version '1.72'
def install
name = "mimetex"
@verus
verus / bayon.rb
Created Jan 17, 2012
Bayon formula for homebrew
View bayon.rb
require 'formula'
class Bayon < Formula
url 'http://bayon.googlecode.com/files/bayon-0.1.0.tar.gz'
homepage 'http://bayon.googlecode.com/'
md5 '7270e483bdb1f7d58c3efbf695e2d427'
def install
system "./configure", "--prefix=#{prefix}"
system "make"
You can’t perform that action at this time.