I hereby claim:
- I am keichan34 on github.
- I am sleepy_keita (https://keybase.io/sleepy_keita) on keybase.
- I have a public key ASASuKTnKfWXIiwyRu4jyTDn-i8LUj1qZLrKHeNPRBtlsAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| defmodule Hi do | |
| keys = ~w(hello there)a | |
| for {key, idx} <- Enum.with_index(keys) do | |
| def index_of_key(unquote(key)) do | |
| {:ok, unquote(idx)} | |
| end | |
| def key_at_index(unquote(idx)) do | |
| {:ok, unquote(key)} |
| # Requires bass and nvm | |
| # bass: https://github.com/edc/bass | |
| # nvm: https://github.com/creationix/nvm | |
| function nvm | |
| set -g NVM_LOADED "1" | |
| bass source ~/.nvm/nvm.sh ';' nvm $argv | |
| end | |
| function ensure_nvm_loaded |
| #!/usr/bin/env elixir | |
| Application.start(:crypto) | |
| key = case System.argv do | |
| [key | _] -> key | |
| _ -> | |
| IO.puts "Usage: ses_credential_generator.exs [AWS Secret Access Key]" | |
| exit(:shutdown) | |
| end |
| { | |
| "presets": ["es2015"] | |
| } |
| <?php | |
| header("Content-Type: application/rss+xml"); | |
| date_default_timezone_set("Asia/Tokyo"); | |
| function formatTime($duration) //as hh:mm:ss | |
| { | |
| $hours = floor($duration / 3600); | |
| $minutes = floor( ($duration - ($hours * 3600)) / 60); | |
| $seconds = $duration - ($hours * 3600) - ($minutes * 60); |
| ~/Desktop > ruby --version | |
| ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14] | |
| ~/Desktop > ruby ./concat_benchmark.rb | |
| Calculating ------------------------------------- | |
| Interpolation 81.309k i/100ms | |
| Array + join 65.714k i/100ms | |
| String concatenation 62.816k i/100ms | |
| String mutation 68.529k i/100ms | |
| ------------------------------------------------- |
| defmodule SimpleHelloWorld do | |
| import Plug.Conn, only: [resp: 3, halt: 1] | |
| def init(_), do: nil | |
| def call(%{request_path: request_path} = conn, _) when request_path == "/" do | |
| conn | |
| |> resp(200, "Hello, world!") | |
| |> halt | |
| end |
| #!/usr/bin/env ruby | |
| require 'benchmark' | |
| Benchmark.bmbm do |x| | |
| x.report("Push x2") do | |
| ary = [] | |
| 100000.times do | |
| ary << 'hi' | |
| ary << 'hihi' |
| <?php | |
| $start_date = date_i18n('Y/m/d H:i:s'); | |
| $start_time = microtime(true); | |
| echo "Start site-wide wp-cron at $start_date\n"; | |
| $sites = wp_get_sites(); | |
| foreach ($sites as $site) { | |
| $url = "http://" . $site['domain'] . $site['path']; |