Skip to content

Instantly share code, notes, and snippets.

View a-suenami's full-sized avatar

Akira Suenami a-suenami

View GitHub Profile
@a-suenami
a-suenami / file0.txt
Created July 1, 2014 05:48
PostgreSQL の timestamp with time zone の等価判定について ref: http://qiita.com/a-suenami/items/dea19256f6ec672d67f1
postgres=# CREATE TABLE orders ( product_id integer, ordered_at timestamp with time zone, CONSTRAINT pkey PRIMARY KEY (product_id, ordered_at) ) ;
CREATE TABLE
postgres=# \d orders
Table "public.orders"
Column | Type | Modifiers
------------+--------------------------+-----------
product_id | integer | not null
ordered_at | timestamp with time zone | not null
Indexes:
class Zzz
end
module XxxRole
def behavior_as_x
puts "zzz is xxx."
end
end
module YyyRole
@a-suenami
a-suenami / passenger.yml
Last active August 29, 2015 14:11
PassengerをインストールするためのAnsible Playbook。
- hosts:
- localhost
connection: local
vars:
- rbenv_root: /home/www/.rbenv
- ruby_version: 2.1.5
tasks:
@a-suenami
a-suenami / model_name.rb
Created March 11, 2015 08:36
Factorygirl sample
FactoryGirl.define do
factory :model_name do
name "Name"
description "Description"
registered_at Time.zone.now
end
end
import java.util.Date
class Me(val name: String, val birthday: Date, val hobbies: Array[Hobby], val techniques: Array[Technique])
case class Hobby(val slug: String, val name: String)
case class Technique(val slug: String, val name: String)
@a-suenami
a-suenami / install_terraform.sh
Last active August 29, 2015 14:18
Install teraffom 0.4.0
#!/bin/sh
mkdir $HOME/.terraform-0.4.0
cd $HOME/.terraform-0.4.0
wget https://dl.bintray.com/mitchellh/terraform/terraform_0.4.0_linux_amd64.zip
unzip terraform_0.4.0_linux_amd64.zip
rm terraform_0.4.0_linux_amd64.zip
echo 'export PATH="$HOME/.terraform-0.4.0:$PATH"' >> $HOME/.bash_profile
source $HOME/.bash_profile
@a-suenami
a-suenami / 摂取栄養素と代謝について.md
Last active August 29, 2015 14:19
摂取栄養素と代謝について

血糖値とインスリン値への影響

糖質

  • 血糖値を上昇させる。
  • インスリンの追加分泌を促す。

タンパク質

  • 血糖値は上昇しない。
package main
import (
"fmt"
"time"
"math/rand"
)
func main() {
n := 1000
@a-suenami
a-suenami / sort.lua
Created February 23, 2012 02:49
sorting program with Lua.
data = {2, 32, 12, 0, 493, 4, 5, 32}
for i = 1, #data do
for j = i + 1, #data do
if data[i] >= data[j] then
tmp = data[i]
data[i] = data[j]
data[j] = tmp
end
end
end
@a-suenami
a-suenami / Hello, World.
Created February 23, 2012 02:33
"Hello, World" with Lua.
print("hello, world!")