Skip to content

Instantly share code, notes, and snippets.

View rozap's full-sized avatar

Chris Duranti rozap

View GitHub Profile
@rozap
rozap / gist:9847622
Last active August 29, 2015 13:57
music organizer
import os
from os import path as ospath
import sys
from mutagen.easyid3 import EasyID3
from mutagen.flac import FLAC
from mutagen._id3util import ID3NoHeaderError
import re
from shutil import copyfile
import subprocess
@rozap
rozap / gist:10946749
Created April 17, 2014 01:22
install an elixir on debian
#!/bin/sh
wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install -y erlang
sudo apt-add-repository -y ppa:bigkevmcd/elixir
sudo apt-get update
sudo apt-get install -y elixir
### Keybase proof
I hereby claim:
* I am rozap on github.
* I am rozap (https://keybase.io/rozap) on keybase.
* I have a public key whose fingerprint is EC4A CCAB 283E A6C2 5046 B081 16B3 5551 6E67 CF9D
To claim this, I am signing this object:
defmodule Plug.Stats do
import Plug.Conn
def init(options) do
options
end
def call(conn, _opts) do
before_time = :os.timestamp()
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
worker(Repo, []),
worker(Service.StatsManager, [[]])
]
config :logger, backends: [:console, :syslog],
format: "$time $metadata[$level] $message\n",
level: :debug
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
foo, bar, baz,
2, 4, 6,
4, 6, 2,
5, 3, 2,
2, 4, 7,
2, 4, 6,
4, 5, 7,
7, 4, 2
## in mix.exs
def application do
[
mod: {MyApplication, []},
applications: [:logger]
]
end