Skip to content

Instantly share code, notes, and snippets.

View jfreeze's full-sized avatar

Jim Freeze jfreeze

View GitHub Profile
@jfreeze
jfreeze / gist:8789534
Last active August 29, 2015 13:55
Dynamo mix.exs
#### DYNAMO MIX FILE ##### DYNAMO Project Mix File Below
defmodule Dynamo.Mixfile do
use Mix.Project
def project do
[ app: :dynamo,
elixir: "~> 0.12.0",
version: "0.1.0-dev",
name: "Dynamo",
source_url: "https://github.com/elixir-lang/dynamo",
@jfreeze
jfreeze / gist:8845632
Created February 6, 2014 14:52
URI.decode
iex(40)> URI.decode("% fred")
** (FunctionClauseError) no function clause matching in URI.hex2dec/1
(elixir) lib/uri.ex:188: URI.hex2dec(32)
(elixir) lib/uri.ex:179: URI.decode/1
@jfreeze
jfreeze / gist:8868387
Created February 7, 2014 18:11
mix.exs for mix docs
defmodule Curl.Mixfile do
use Mix.Project
def project do
[ app: :curl,
version: "0.0.1",
elixir: "~> 0.12.2",
name: "Curl",
source_url: "http:localhost:4000", deps: deps ]
end
$ find _build/
_build/
_build//shared
_build//shared/lib
_build//shared/lib/curl
_build//shared/lib/curl/.compile.elixir
_build//shared/lib/curl/.compile.lock
_build//shared/lib/curl/ebin
_build//shared/lib/curl/ebin/curl.app
_build//shared/lib/curl/ebin/Elixir.Curl.beam
@jfreeze
jfreeze / gist:8873327
Created February 7, 2014 22:28
Doc issue Elixir 0.12.2
mix new doctest
cd doctest
Add the following to mix.exs
{ :ex_doc, github: "elixir-lang/ex_doc", ref: "f9c1d88acf8211f41c786750d47e9459b885241f" }
mix deps.get
* Getting ex_doc (git://github.com/elixir-lang/ex_doc.git)
Cloning into '/Users/jimfreeze/Documents/Projects/PlugnPay/doctest/deps/ex_doc'...
remote: Reusing existing pack: 2286, done.
@jfreeze
jfreeze / gist:9076669
Created February 18, 2014 18:22
N2O and Elixir
ims-MacBook-Pro-3:n2o_elixir jimfreeze$ mix run --ho-halt
Compiled lib/sample/sup.ex
Compiled lib/sample/routes.ex
Compiled lib/sample.ex
Compiled lib/sample/index.ex
== Compilation error on file lib/sample/n2o.ex ==
** (RuntimeError) error parsing file /Users/jimfreeze/Documents/Projects/N2O/n2o_elixir/_build/dev/lib/cowboy/src/cowboy_req.erl, got: {:error, :enoent}
(elixir) lib/record/extractor.ex:55: Record.Extractor.read_file/1
(elixir) lib/record/extractor.ex:33: Record.Extractor.retrieve_record/2
lib/sample/n2o.ex:11: (module)
@jfreeze
jfreeze / gist:9174964
Created February 23, 2014 18:09
Github-backup Compile Problems
$ make
if [ "cabal " = ./Setup ]; then ghc --make Setup; fi
cabal configure
Resolving dependencies...
[ 1 of 20] Compiling Utility.Env ( Utility/Env.hs, dist/setup/Utility/Env.o )
[ 2 of 20] Compiling Utility.UserInfo ( Utility/UserInfo.hs, dist/setup/Utility/UserInfo.o )
[ 3 of 20] Compiling Utility.PartialPrelude ( Utility/PartialPrelude.hs, dist/setup/Utility/PartialPrelude.o )
[ 4 of 20] Compiling Utility.FileSystemEncoding ( Utility/FileSystemEncoding.hs, dist/setup/Utility/FileSystemEncoding.o )
[ 5 of 20] Compiling Utility.Applicative ( Utility/Applicative.hs, dist/setup/Utility/Applicative.o )
[ 6 of 20] Compiling Utility.Data ( Utility/Data.hs, dist/setup/Utility/Data.o )
@jfreeze
jfreeze / gist:9423233
Created March 8, 2014 00:34
Installing Elixir on Raspberry Pi
My quick notes on what I did to install Elixir on the Raspberry Pi.
All the info is here, but it's a self guided tour.
# Get Raspbian
http://www.raspberrypi.org/downloads
http://downloads.raspberrypi.org/raspbian_latest
# Copy raspbian.img file to th SD Card
diskutils unmountDisk /dev/disk<numberhere>
@jfreeze
jfreeze / gist:10736240
Created April 15, 2014 14:16
Date Formatting
{{y,m,d},{_,_,_}} = :calendar.universal_time
to_string(List.flatten(:io_lib.fwrite("~2.2.0w/~2.2.0w/~w", [m,d,y])))
@jfreeze
jfreeze / gist:b455b5c1728f9a71af24
Created April 30, 2014 16:35
Mix.exs dependencies
In mix.exs of MyApp
def application do
[
mod: { MyApp, [] },
applications: [ :httpoison ],
env: [
account: [ company: "WIC" ]
]
]
end