View search_worker3.exs
defmodule SearchWorker do
use GenServer
@idle_timeout_ms 10 * 60 * 1000
# client api
def touch(pid) do
GenServer.cast(pid, :touch)
end
View search_worker2.exs
defmodule SearchWorker do
use GenServer
@idle_timeout_ms 10 * 60 * 1000
# client api
def touch(pid) do
GenServer.cast(pid, :touch)
end
View search_worker1.exs
defmodule SearchWorker do
use GenServer
@idle_timeout_ms 10 * 60 * 1000
@impl GenServer
def init(state) do
# send ourselves a message after 10 seconds and cleanup the proc tree when we get this
Process.send_after(self(), :idle_timeout, @idle_timeout_ms)
{:ok, state}
View search_worker1.exs
defmodule SearchWorker do
use GenServer
@idle_timeout_ms 10 * 60 * 1000
@impl GenServer
def init(state) do
# send ourselves a message after 10 seconds and cleanup the proc tree when we get this
Process.send_after(self(), :idle_timeout, @idle_timeout_ms)
{:ok, state}
View xmonad.hs
import XMonad
main = do
xmonad $ defaultConfig
{ terminal = myTerminal
, modMask = myModMask
, borderWidth = myBorderWidth
}
myTerminal = "urxvt"
View curl-websocket.sh
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
View Effective_Engineer.md

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

View activetable.js
// ActiveTable - a bookmarklet to make tables sortable and editable
function init() {
var aHrows = getHrows();
var numHrows = aHrows.length;
var aHidden = getHiddenColumns();
ATpopup = document.createElement("div");
ATpopup.style.cssText = "position: absolute; visibility: hidden; padding: 0; font-family: Arial; background-color: rgba(255, 255, 255, 0.9); border-radius: .5em; text-align: center; box-shadow: .05em .05em .5em #00C;";
ATpopup.innerHTML = "<a href='sort' title='sort' onclick='sortColumn(); return false'><img border=0 src='http://stevesouders.com/images/sort_up_down.png' style='padding-top: 0.2em;'></a><br><a href='hide' style='color: #C00; font-family: monospace; font-size: 1.5em; text-decoration: none;' title='hide' onclick='hideColumn(); return false'>x</a>"; // TODO - use protocol-less URL for img
View phoenix_to_umbrella
How to convert existing phoenix app to an umbrella app.
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
[10:14]
1) mix new my_umbrella --umbrella
View recover_source_code.md

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb