Skip to content

Instantly share code, notes, and snippets.

View akiomik's full-sized avatar
🇺🇦
I may be slow to respond.

Akiomi Kamakura akiomik

🇺🇦
I may be slow to respond.
View GitHub Profile
@akiomik
akiomik / devise.md
Created February 18, 2014 03:58
deviseで作られるカラムとインデックス

environment

  • rails 4.0.1
  • devise 3.2.2

columns

helper type column null default index remarks
authenticatable string email false "" unique
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]
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)
@akiomik
akiomik / coredatautil.rb
Created September 9, 2015 05:36
a homebrew cask formula for CoreDataUtility
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 September 15, 2015 03:40
a homebrew formula for cocos2d-x v3.7.1

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
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@akiomik
akiomik / vim-over.md
Last active December 28, 2015 20:29
vim-over使用時のエラー

環境

どのバージョンも osyo-manga/vim-over@97d98c605e43669b05e55f2f52e90c44e8f7f21c で確認しました。

  • エラーを確認したバージョン
    • vim 7.2 on debian(wheezy)
  • 正常に動いたバージョン
    • vim 7.3 on osx(10.9)
    • vim 7.4 on osx(10.9)
@akiomik
akiomik / rails.md
Last active December 29, 2015 19:10
rails環境構築メモ
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を適用
@akiomik
akiomik / rec.hs
Last active January 1, 2016 09:29
すごいH本第4章の再帰をscalaで書く
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 / suko-bench.md
Last active January 2, 2016 22:59
suko puzzles solverのベンチマーク

概要

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

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

ベンチマーク方法

new scala.testing.Benchmark {