Skip to content

Instantly share code, notes, and snippets.

Avatar
🐟
sakana

Akiomi Kamakura akiomik

🐟
sakana
View GitHub Profile
@akiomik
akiomik / coredatautil.rb
Created Sep 9, 2015
a homebrew cask formula for CoreDataUtility
View coredatautil.rb
cask :v1 => 'coredatautil' do
version '1.5.8'
sha256 '6e158ee215cde14582191804abc965b38db6f911fb22068631c80313fe0b90a8'
url 'https://github.com/yepher/CoreDataUtility/releases/download/1.5_8/CoreDataUtil.app.zip'
name 'CoreDataUtility'
homepage 'https://github.com/yepher/CoreDataUtility/releases'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
app ''
@akiomik
akiomik / README.md
Last active Sep 15, 2015
a homebrew formula for cocos2d-x v3.7.1
View README.md

Change the plugin path of /usr/local/opt/cocos2d-x/bin/cocos2d.ini.

53c53
< plugins=../plugins
---
> plugins=/usr/local/opt/cocos2d-x/tools/cocos2d-console/plugins
View calc.scala
case class Calc(f: Int => Int, g: Int => Int, i: Int = 1) {
def calc: Int = (f compose g)(i)
}
object Calc {
def apply(f: Int => Int, g: Int => Int): Calc = new Calc(f, g)
}
// case class
val c1 = new Calc(_ * 10, _ + 10)
View fizzbuzz-faster.scala
import shapeless._
import shapeless.Nat._
import shapeless.ops._
import shapeless.ops.nat._
trait FizzBuzz[N <: Nat] {
type R3 <: Nat
type R5 <: Nat
def ti: ToInt[N]
@akiomik
akiomik / devise.md
Created Feb 18, 2014
deviseで作られるカラムとインデックス
View devise.md

environment

  • rails 4.0.1
  • devise 3.2.2

columns

helper type column null default index remarks
authenticatable string email false "" unique
@akiomik
akiomik / ng.md
Last active Jan 3, 2016
case class and companion object
View ng.md
case class Calc(f: Int => Int, g: Int => Int, i: Int = 1) {
  def calc: Int = (f compose g)(i)
}

object Calc {
  def apply(f: Int => Int, g: Int => Int): Calc = new Calc(f, g)
}
@akiomik
akiomik / suko-bench.md
Last active Jan 2, 2016
suko puzzles solverのベンチマーク
View suko-bench.md

概要

sukoというパズルの適当なソルバを書いたので簡単なベンチマークを取ってみた。

問題は2014/01/06のmetro紙より。

ベンチマーク方法

new scala.testing.Benchmark {
@akiomik
akiomik / rec.hs
Last active Jan 1, 2016
すごいH本第4章の再帰をscalaで書く
View rec.hs
replicate' :: Int -> a -> [a]
replicate' n x
| n <= 0 = []
| otherwise = x : replicate' (n - 1) x
take' :; Int -> [a] -> [a]
take' n _
| n <= 0 = []
take' _ [] = []
take' n (x : xs) = x : take' (n - 1) xs
@akiomik
akiomik / .gitattributes
Created Dec 19, 2013
gitattributes for scala
View .gitattributes
*.scala diff=scala
@akiomik
akiomik / rails.md
Last active Dec 29, 2015
rails環境構築メモ
View rails.md
brew install rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bashrc
echo 'eval "$(rbenv init -)"' >> .bashrc

git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install -l # 入れれるバージョン
rbenv install 2.0.0-rc2
rbenv versions # バージョン確認
rbenv global 2.0.0-rc2 # rc2を適用