Skip to content

Instantly share code, notes, and snippets.

View rozap's full-sized avatar

Chris Duranti rozap

View GitHub Profile
<kml:kml xmlns:kml="http://earth.google.com/kml/2.1">
<kml:Document id="featureCollection">
<Folder id="???">
<Placemark id="fid-7adab59e_14f666dec01_-7f70">
<ExtendedData>
<SchemaData>
<SimpleData name="an_int">1</SimpleData>
<SimpleData name="a_string">1</SimpleData>
<SimpleData name="a_float">1.1</SimpleData>
</SchemaData>
@rozap
rozap / gist:5f23fbb9b12e4c6cf9b9
Created July 22, 2015 00:23
tracking how long i spend waiting for sbt
#!/bin/bash
timestamp() {
date +%s%3N
}
watch_dir=$1
echo "Watching $watch_dir ..."
def authors(cd) do
#Connect to the database.
conn = RethinkDB.connect([host: "10.0.0.30", port: 28015])
q = case cd do
"create" -> table_create("authors")
"destroy" -> table_drop("authors")
end
|> run(conn)
defp table_action("create"), do: table_create("authors")
defp table_action("destroy"), do: table_drop("authors")
def authors(cd) do
#Connect to the database.
conn = RethinkDB.connect([host: "10.0.0.30", port: 28015])
q = table_action(cd) |> run(conn)
defmodule Foo do
defp make_guard(:any), do: true
defp make_guard(token) do
quote do
head == token
end
end
## in mix.exs
def application do
[
mod: {MyApplication, []},
applications: [:logger]
]
end
foo, bar, baz,
2, 4, 6,
4, 6, 2,
5, 3, 2,
2, 4, 7,
2, 4, 6,
4, 5, 7,
7, 4, 2
def rank_to_int({_, "J"}), do: 11
def rank_to_int({_, "Q"}), do: 12
def rank_to_int({_, "K"}), do: 13
def rank_to_int({_, "A"}), do: 14
def rank_to_int({_, n}), do: n
config :logger, backends: [:console, :syslog],
format: "$time $metadata[$level] $message\n",
level: :debug
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
worker(Repo, []),
worker(Service.StatsManager, [[]])
]