Skip to content

Instantly share code, notes, and snippets.

@a-hisame
a-hisame / dump.py
Created December 4, 2014 10:07
DynamoDBのダンプを取るプログラム。
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Get Dump from DynamoDB (All Tables).
This program does not cover all DynamoDB format,
but It's good enough for me.
restore.py can restore Tables from this outputs JSON files.
@a-hisame
a-hisame / non-implements-eq.hs
Created September 3, 2014 08:31
当たり前だけれど、Eqのデフォルト実装を上書きしない場合、無限ループに陥る。
-- test on ghci console
data Present a = Redbox a | Bluebox a deriving Show
instance Eq (Present a)
let a = Redbox 10
let b = Redbox 30
-- never stop
a == b
@a-hisame
a-hisame / create_spots.py
Created July 30, 2014 12:39
Create AWS Spot Instance Automation
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
スポットインスタンスを自動的に指定個数リクエストをかけてインスタンスを作る。
作成したインスタンスIDを標準出力する。
Python2.7 + boto で動作確認。
キーを残したくない場合はコネクションの作成を工夫すること。
#include<iostream>
#include<algorithm>
#include<vector>
#include<boost/lexical_cast.hpp>
#include<boost/iterator/counting_iterator.hpp>
int main(void) {
std::vector<std::string> fizzbuzz;