This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp do | |
def start(_type, _args) do | |
get_args() | |
|> run() | |
|> stop() | |
end | |
# 引数取得 | |
# 実行時の引数を受け取る場合は `:init.get_plain_arguments/0` を使う。 | |
# ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM frolvlad/alpine-oraclejdk8 | |
# Create working space | |
# RUN mkdir /var/dynamodb_wd | |
WORKDIR /var/dynamodb_wd | |
# Default port for DynamoDB Local | |
EXPOSE 8000 | |
# Get the package from Amazon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyMap do | |
@doc """ | |
flatten given map with nested key. | |
All keys must be atom or binary. | |
Returns map | |
## Examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :aws do | |
# http://docs.aws.amazon.com/sdkforruby/api/frames.html | |
# http://qiita.com/itayan/items/112f23cbff13e49cdb53 | |
desc 'send mail' | |
task send_mail: :environment do |_t, _args| | |
ses = Aws::SES::Client.new(region: 'us-west-2') | |
body_text = <<-EOS | |
こんにちは。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
func main() { | |
workers := 3 | |
var wg sync.WaitGroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"os" | |
"github.com/codegangsta/cli" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) | |
type Response map[string]interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func DefaultHandler(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Hello, HTTP!!!") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* UTF-8 to SHIFT_JIS | |
* 全角波線などUTF-8からSHIFT_JIS変換時に文字化けするものを置換 | |
* 参考:http://d.hatena.ne.jp/sardine/20060214/p1 | |
*/ | |
def replaceInvalidChars(s: String): String = | |
s.replaceAll("\u301c", "\uff5e"). //~ (波ダッシュ) | |
replaceAll("\u2212", "\uff0d"). //- (マイナス) | |
replaceAll("\u2016", "\u2225") //∥ (二重垂直線) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"path/filepath" | |
"strings" | |
) |
NewerOlder