Skip to content

Instantly share code, notes, and snippets.

View daiksy's full-sized avatar

KASUYA, Daisuke daiksy

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
@seratch
seratch / build.sbt
Created December 1, 2011 06:07
Scala School - Testing with specs2 examples
organization := "net.seratch"
name := "sandbox"
version := "0.1"
scalaVersion := "2.9.1"
libraryDependencies ++= Seq(
"junit" % "junit" % "4.9" withSources(),
@mumoshu
mumoshu / readme.md
Created August 25, 2012 10:05
Serializing/deserializing instances of a case class

scala -Xcheckinit だと TransietnVariablesトレイトで定義したフィールドへのアクセス時に以下のような例外が発生する。

scala.UninitializedFieldError: Uninitialized field: <console>: 20
	at Container._boolean(<console>:20)
	at TransientVariables$class.boolean(<console>:31)
	at Container.boolean(<console>:20)
	at .<init>(<console>:39)
	at .<clinit>(<console>)
	at .(:11)
@xuwei-k
xuwei-k / problem2.scala
Created November 13, 2012 13:01 — forked from daiksy/problem2.scala
Project Euler Probrem 2
/*
* http://projecteuler.net/problem=2
* http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%202
*/
val fib: List[Int] => List[Int] = {
case Nil | _ :: Nil => throw new IllegalArgumentException
case xs @ (a :: b :: tail) => {
val nextNum = a + b
if (nextNum >= 4000000) {
xs
anonymous
anonymous / Main.scala
Created December 16, 2012 04:36
Scalaでirof式。
object Main extends App {
class irof[A](val condition: Boolean)(block: => A) {
lazy val value = block
def elof[B, C](elsePart: => B)(implicit e1: A <:< C, e2: B <:< C): C = {
if (condition) value else elsePart
}
}
object irof {
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "centos64_64"
config.vm.define :web do |india|
india.vm.host_name = "india"
india.vm.network :hostonly, "192.168.50.12"
@kshoji
kshoji / README.md
Created February 13, 2014 04:11
拝承プラットフォームに変換するChrome拡張

使いかた

  • manifest.json と script.js を適当な、同じディレクトリ内に保存します。
  • Chromeの設定画面を開き、拡張機能の画面を出します。
  • 「デベロッパーモード」のチェックボックスにチェックを入れます。
  • 「パッケージされていない拡張機能を読み込む」ボタンを押し、先程のディレクトリを選択します。
  • http://daishonin.hatelabo.jp/ を開きます。
@j5ik2o
j5ik2o / diet.md
Last active January 11, 2024 13:22

僕が実践した糖質制限の方法を下記に記します。ご参考までに。

連絡先
twitterはj5ik2o
Facebookもj5ik2o
LINEはj5ik2o
gmailはj5ik2o あっと gmail.com

注意事項:私は医者でも栄養士でもないので、ここに書かれたことは間違っている可能性もあります。ご自分で十分に注意して実践してください。必要なら専門家の指導を受けた方がいいと思います。

//Zコンビネータ
//再帰する関数を定義するのに使う
ZCONB = { f -> ({ x -> f({ y -> x(x)(y) }) })({ x -> f({ y -> x(x)(y) }) }) }
//数の定義
ZERO = { f -> { x -> x }}
ONE = { f -> { x -> f(x) }}
THREE = { f -> { x -> f(f(f(x))) }}
FIVE = { f -> { x -> f(f(f(f(f(x))))) }}
@tksmd
tksmd / mackerel_jvm8_heap.py
Created September 15, 2015 12:39
Mackerel Jolokia JVM8 sample
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import urllib2
import json
import os
import tempfile
import codecs
from optparse import OptionParser