This file contains hidden or 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
| #!/bin/bash | |
| middleman build && | |
| echo "--- middleman build complete" | |
| git checkout master && | |
| echo "--- cleaning old build" | |
| (ls -1 | grep -v 'build' | xargs rm -rf ) && |
This file contains hidden or 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 Timing do | |
| def now do | |
| :os.system_time(:milli_seconds) | |
| end | |
| # broken! the block is executed immediately | |
| # | |
| def ftime([do: block]) do | |
| t0 = now | |
| { :ok, block, now - t0 } |
This file contains hidden or 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
| def memory_kb | |
| `ps -o rss= -p #{Process.pid}`.chomp.to_i | |
| end | |
| MEM_LOG = "current memory: %{mem} kB (+%{incr})".freeze | |
| THR_LOG = "New Thread!".freeze | |
| current_mem = 0 | |
| loop do | |
| m = memory_kb() |
This file contains hidden or 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
| require "colorize" | |
| REGISTRY = {} | |
| DEBUG = false | |
| SLEEP = 0.5 | |
| def register(id) | |
| mailbox = Queue.new | |
| Thread.current[:process_id] = id | |
| REGISTRY[id] = mailbox |
OlderNewer