Skip to content

Instantly share code, notes, and snippets.

View bitwalker's full-sized avatar

Paul Schoenfelder bitwalker

View GitHub Profile
@martin-langhoff
martin-langhoff / gist:5d16a2e08bdb7ef950526cce83bc9e27
Created August 23, 2016 22:04
Read in sys.config in an Elixir Release under 'console_clean'
# 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 December 18, 2018 23:13
Retrieving application version number in mix.exs from git describe
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 October 9, 2023 09:28
How to run Ecto migrations from an exrm release
./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 August 16, 2014 23:38
Quick and dirty PowerShell Tricks
# 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 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>
@dch
dch / erlang.rb
Last active August 29, 2015 13:56
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`
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'