Skip to content

Instantly share code, notes, and snippets.

View shizone's full-sized avatar

SUMIDA Yuki shizone

View GitHub Profile
@shizone
shizone / Excel方眼紙アドイン
Created May 20, 2011 02:47
Excel方眼紙アドイン
Option Explicit
Sub AddNewMenu()
On Error GoTo ErrHand
Dim cbrCmd As CommandBar
Dim cbcMenu As CommandBarControl
Set cbrCmd = Application.CommandBars("Worksheet Menu Bar")
cbrCmd.Controls("方眼紙").Delete
@shizone
shizone / gist:986884
Created May 23, 2011 15:26
Scala REPLで入力したコードをそのままTwitterへPostするwrap
// twitter4j-coreのパスを指定
:cp <TWITTER4J_HOME>/lib/twitter4j-core-X.X.X.jar
:power
import twitter4j.Twitter
import twitter4j.TwitterFactory
import twitter4j.auth.AccessToken
// 各自Twitter developersでアプリケーション登録して取得した値を設定してください
@shizone
shizone / deploy
Created November 4, 2011 14:40
Sphinx文書をビルドしてGAEに突っ込むJenkins用シェルスクリプト雛形
cd ${WORKSPACE}
make html
cp -fr ${WORKSPACE}/build/html/* ${WORKSPACE}/gae/war/
${APPENGINE_SDK_HOME}/bin/appcfg.sh -e ${EMAIL} --passin update ${WORKSPACE}/gae/war <<EOF
${PASSWORD}
EOF
@shizone
shizone / fhb.user.js
Created November 23, 2011 06:46
Facebook Hentai Button
// ==UserScript==
// @name Facebook Hentai Button
// @namespace http://d.hatena.ne.jp/razon/
// @description Hentai Advent Calendar 2011/11/26.
// @include http://www.facebook.com/plugins/like*
// ==/UserScript==
(function() {
document.getElementsByClassName('liketext')[0].innerHTML='変態!';
}
@shizone
shizone / gist:1438364
Created December 6, 2011 14:22
http://codr.cc/356776/rb を見て何となく
scala> sealed trait Color
defined trait Color
scala> case object Black extends Color
defined module Black
scala> case object Pink extends Color
defined module Pink
scala> case class Pants(color: Color)
@shizone
shizone / boss.scala
Created December 8, 2011 03:11
ボス
class Boss {
protected var age_ : Int = _
def age = age_
def age_=(value: Int): Unit = this.age_ = value
}
val tama: Boss = new Boss {
override def age = if (20 < this.age_) 20 else this.age_
}
tama.age = 0x20
@shizone
shizone / Scalaちゃん.svg
Created December 8, 2011 15:10
Scala Advent Calendar jp 2011向けに作ったScalaちゃんのSVG(DLして好きに弄り倒してください)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shizone
shizone / test.js
Created January 26, 2012 14:09
ocamljsが吐いたソースが怖い
// compiled by ocamlc 3.12.0, ocamljs 0.3
var ocamljs$caml_named_value = (function (){
var Match_failure$16g = "Match_failure";
var Out_of_memory$17g = "Out_of_memory";
var Stack_overflow$24g = "Stack_overflow";
var Invalid_argument$18g = "Invalid_argument";
var Failure$19g = "Failure";
var Not_found$20g = "Not_found";
var Sys_error$21g = "Sys_error";
var End_of_file$22g = "End_of_file";
@shizone
shizone / gist:3103324
Created July 13, 2012 07:19
java.util.Date#getTime同士の比較でズレが出る回数の検証
scala> import java.util.Date
def f(n: Int): Int =
if (new Date().getTime != new Date().getTime) n else f(n + 1)
f(0)
import java.util.Date
f: (n: Int)Int
res0: Int = 15090
scala> f(0)
res1: Int = 52401
@shizone
shizone / hentai.scala
Created July 17, 2012 14:24
変態アドベントカレンダー in Summerに参加した物好きどもをTwitterのListに晒しあげるスクリプト
#!/usr/bin/env xsbtscript
!#
/***
scalaVersion := "2.9.2"
libraryDependencies ++= Seq(
"org.twitter4j" % "twitter4j-core" % "[2.2,)"
)
*/