Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Schoenfelder bitwalker

View GitHub Profile
@martin-langhoff
martin-langhoff / gist:5d16a2e08bdb7ef950526cce83bc9e27
Created Aug 23, 2016
Read in sys.config in an Elixir Release under 'console_clean'
View gist:5d16a2e08bdb7ef950526cce83bc9e27
# Read sys.config as in a normal start
{ :ok, [ conf ] } = :file.consult('/path/to/running-config/sys.config')
Enum.each(conf, fn({k, v}) ->
Enum.each(v, fn({sk, sv}) ->
Application.put_env(k, sk, sv)
end)
end)
@jeffweiss
jeffweiss / mix.exs
Last active Dec 18, 2018
Retrieving application version number in mix.exs from git describe
View mix.exs
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app,
version: get_version,
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: Mix.compilers,
build_embedded: Mix.env == :prod,
@ericentin
ericentin / migrate.sh
Last active Nov 23, 2016
How to run Ecto migrations from an exrm release
View migrate.sh
./bin/turbo rpc Elixir.Ecto.Storage up "['Elixir.Turbo.Repo']."
./bin/my_app rpc Elixir.Mix.Ecto migrations_path "['Elixir.MyApp.Repo']."
# => <<"/opt/my_app/production/rel/my_app/lib/my_app-0.0.1/priv/repo/migrations">>
./bin/my_app rpc Elixir.Ecto.Migrator run "['Elixir.MyApp.Repo', <<\"/opt/my_app/production/rel/my_app/lib/my_app-0.0.1/priv/repo/migrations\">>, up, [{all, true}]]."
# => []
@RamblingCookieMonster
RamblingCookieMonster / Examples.ps1
Created Aug 16, 2014
Quick and dirty PowerShell Tricks
View Examples.ps1
# A few handy tricks I use on a daily basis, from various sources
# Running with UAC and already elevated? No prompts if you call things from here : )
New-Alias -name hyperv -Value "$env:windir\system32\virtmgmt.msc"
New-Alias -name vsphere -value "C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe"
New-Alias -Name n -Value "C:\Tools\NotePad2\notepad2.exe"
New-Alias -name RSAT -Value "C:\Tools\Custom.msc"
#...
@jfreeze
jfreeze / gist:9423233
Created Mar 8, 2014
Installing Elixir on Raspberry Pi
View gist:9423233
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>
@dch
dch / erlang.rb
Last active Aug 29, 2015
Install OTP 17.0-rc2 via homebrew: `brew install wxmac && brew install --no-docs --with-dirty-schedulers --time --devel -v https://gist.githubusercontent.com/dch/9267866/raw/erlang.rb`
View erlang.rb
require 'formula'
# Major releases of erlang should typically start out as separate formula in
# Homebrew-versions, and only be merged to master when things like couchdb and
# elixir are compatible.
class Erlang < Formula
homepage 'http://www.erlang.org'
# Download tarball from GitHub; it is served faster than the official tarball.
url 'https://github.com/erlang/otp/archive/OTP_R16B03-1.tar.gz'
sha1 'b8f6ff90d9eb766984bb63bf553c3be72674d970'