Skip to content

Instantly share code, notes, and snippets.

View msakai's full-sized avatar

Masahiro Sakai msakai

View GitHub Profile
@msakai
msakai / fakecoin.als
Created January 13, 2011 00:29
贋金パズルのAlloyモデル
// 失敗版
sig Coin {}
abstract sig State {
  candidates : set Coin,
}
sig Branch extends State {
  left, right : set Coin, 
  eq, lt, gt : State
@etale
etale / tropical.rb
Created October 4, 2011 05:48
an implementation of complex numbers with tropical flavor
# tropical.rb
# an implementation of complex numbers with tropical flavor
#
# self == e^{ord + 2 \pi i arg}
class Class
def get *args, &block
(new *args, &block).identity
end
end
@etale
etale / alg.rb
Last active September 27, 2015 17:47
an implementation of adeles
def not_implemented
puts "#{inspect} : #{self.class}"
raise NotImplementedError
end
$radix ||= 10 # 2 <= $radix <= 36
$adic ||= 10**4 # 2 <= $adic
$delim ||= ',' # or '|', etc.
$type ||= :arch # or :adic
$prec ||= 4 # default precision
@jamesadney
jamesadney / pil_to_pyglet.py
Created March 4, 2012 08:28
Load pyglet image from PIL
temp_image = Image.open("picture.png")
raw_image = temp_image.tostring()
image = pyglet.image.ImageData(width, height, 'RGB', raw_image, pitch= -resized_x * 3)
@rummelonp
rummelonp / mm2bl.rb
Created June 16, 2012 08:41
メディアマーカーの CSV をブクログ形式にするやつ
# -*- coding: utf-8 -*-
#
# メディアマーカーの CSV をブクログ形式にするやつ
# 使い方
# ruby mm2bl.rb /path/to/MediaMarkerExport.csv > output.csv
# 参考
# http://d.hatena.ne.jp/Unicellular/20120507/1336411135
require 'csv'
@voluntas
voluntas / gist:73efe2f36ac1513c02a8
Created August 5, 2012 16:13
レビューのススメ?

レビューのススメ?

typo 死ぬほど多いので突っ込みまってます

バージョン:0.2.3
作者:@voluntas

考え方はコロコロ変わるタイプなのですが、最近はレビューが実はとても大事でとにもかくにもレビューなのでは?と思い始めてきています。

@Gab-km
Gab-km / github-flow.ja.md
Last active October 29, 2024 10:17 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@willwade
willwade / citeusync.py
Last active April 7, 2019 01:48
inspired by the perl version - but not quite the same. Simply use to download your bibtex file and attachments on a regular basis. NB: Only downloads the PDF if not already present so technically only 2 calls at a minimum to CUL (Login and download of bibtex. Obviously a lot more if downloading the PDFs). If more than one attachment - will only …
#!/usr/bin/env python
# Contact: Will Wade willwa.de
# Date: April 2013
# Needs mechanize and pybtex
#
# NB: Little error checking going on in this script
# TO-DO: Check last-download-date of bibtex file later than last-modified date on CUL. ? possible
#
# With thanks to https://pypi.python.org/pypi/citeulike_api/0.1.3dev for the login part
import mechanize
@araipiyo
araipiyo / speed.rb
Created June 1, 2014 06:27
measure speed of HTTP GET at any particular site.
require 'net/http'
require 'uri'
url = URI.parse(ARGV[0])
http = Net::HTTP.new(url.host, url.port)
path = url.path != '' ? url.path : '/'
path += url.query ? "?#{url.query}" : ""
secs = []
@exoego
exoego / 転職先に訊きたいチェックリスト.md
Last active May 25, 2024 15:30
転職活動してて訊きたいことのメモ

制度

  • 有休…
  • 病休…
  • 育休…
  • 年収(月給、賞与など)…
  • 残業代…
  • 早朝/深夜手当…
  • 休出手当…
  • 住宅補助…