This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env escript | |
%% -*- mode: erlang -*- | |
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*- | |
%% ex: ts=4 sw=4 ft=erlang et | |
%% | |
%% Copyright 2016 Operable, Inc. All Rights Reserved. | |
%% | |
%% This file is provided to you under the Apache License, | |
%% Version 2.0 (the "License"); you may not use this file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# To install dependencies: brew install pandoc chrome-cli fswatch | |
# To use: mdpreview /path/to/content.md | |
monitored_file=`basename $1` | |
preview="/tmp/${monitored_file}.html" | |
preview_url="file://${preview}" | |
trap "rm -f ${preview};exit;" SIGINT SIGTERM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iex(1)> f = Contex.Target.compute(10, 20) | |
# c is 30 | |
iex(2)> f.(100) | |
3000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ERL_HOME=/opt/erl | |
if [[ "${ERL_HOME}" != */ ]]; then | |
ERL_HOME=${ERL_HOME}/ | |
fi | |
LINK_DIRS="bin lib man" | |
find_active() { | |
HOME_DEPTH=`echo ${ERL_HOME} | grep -o / | wc -l` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop function get_table_metrics CASCADE; | |
drop type operable_table_metrics CASCADE; | |
CREATE TYPE operable_table_metrics AS (what text, bytes bigint, bytes_pretty text, per_row_bytes bigint); | |
CREATE OR REPLACE FUNCTION get_table_metrics(tname text) | |
RETURNS SETOF operable_table_metrics | |
LANGUAGE plpgsql | |
STABLE | |
STRICT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ebin_glob="" | |
if [ $# -eq 0 ]; then | |
printf "Detecting build path..." | |
if [ -d ./_build/dev/lib ]; then | |
ebin_glob="./_build/dev/lib/*/ebin" | |
printf "found (${ebin_glob})\n" | |
else | |
printf "skipped\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iex(1)> foo | |
** (RuntimeError) undefined function: foo/0 | |
iex(1)> %{a: foo} = %{a: 1} | |
%{a: 1} | |
iex(2)> foo | |
1 | |
iex(3)> %{a: foo} = %{a: 2} | |
%{a: 2} | |
iex(4)> foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Fstop.Model do | |
defmacro __using__(_) do | |
quote do | |
use Ecto.Model | |
@after_compile {Fstop.Enumerator, :generate} | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Put this script in your path and execute it like so: | |
# `git checkpoint` | |
# or | |
# `git checkpoint lib/foo/foo_thing.ex` | |
# Bail as soon as an error happens | |
set -e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) | |
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) | |
devtmpfs on /dev type devtmpfs (rw,nosuid,size=16327544k,nr_inodes=4081886,mode=755) | |
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) | |
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) | |
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) | |
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) | |
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755) | |
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) | |
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) |