This file contains 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
# | |
# Demo usage of ex_slp_tk for OpenSLP based Elixir node clustering | |
# see the library at: https://github.com/icanhazbroccoli/ex_slp_tk | |
# | |
# To use the code below, add something like this for your application's supervisor: | |
# | |
# children = children ++ [supervisor(Discovery.Supervisor, [])] | |
# supervise(children, opts) | |
# | |
require Logger |
This file contains 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
# |
This file contains 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
# playbook.yml | |
# installs ielixir/jupyter on a stand-alone docker. | |
# see: http://mattvonrocketstein.github.io/heredoc/ielixir-notebook-in-docker.html | |
- hosts: docker | |
become: yes | |
become_method: sudo | |
gather_facts: False | |
vars: | |
erls_url: "https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb" | |
ielixir_repo: "https://github.com/pprzetacznik/IElixir.git" |
This file contains 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
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
from fabric import api | |
from fabric import colors | |
from fabric.contrib.console import confirm | |
PKG_NAME = 'PKG_NAME' | |
THIS_DIR = os.path.dirname(os.path.abspath(__file__)) |
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
import os | |
import contextlib | |
from fabric import api | |
PKG_NAME = 'MY_PKG' | |
VULTURE_EXCLUDE_PATHS = ['tests', ] | |
VULTURE_IGNORE_FUNCTIONS = ['commandline_entry_point'] |
This file contains 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
# -*- coding: utf-8 -*- | |
import os | |
from fabric import api | |
from fabric import colors | |
from fabric.contrib.console import confirm | |
_ope = os.path.exists | |
_mkdir = os.mkdir | |
_expanduser = os.path.expanduser | |
_dirname = os.path.dirname |
This file contains 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
import os, sys | |
import inspect | |
import unittest, unittest2 | |
from django import test as dtest | |
import nose | |
def _suite2list(s): | |
return [x for x in _suite2iter(s)] |
This file contains 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
defmacro print(thing) do | |
if String.valid?(thing) do | |
quote bind_quoted: binding() do | |
IO.puts thing | |
end | |
else | |
quote bind_quoted: binding() do | |
IO.puts("#{inspect thing}") | |
end | |
end |
This file contains 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
""" pyack | |
a dumb interface for getting ack data into python | |
USAGE: | |
call it with a given search string or directory | |
>>> z = pyack('search_string') | |
>>> z = pyack('search_string directory') | |
>>> z = pyack('search_string directory --whatever-ack-args') |
This file contains 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
""" some decorator hacks for defeating annoying race conditions """ | |
def when(predicate, limit=100, sleep_time=1, eager=False): | |
""" this function is dedicated to Christopher Michael Heisel | |
When predicate is True, the decorated function will run | |
(and nevermind exactly when it was called). If the predicate | |
tests False for more times than <limit>, this function will | |
simply exit and the decorated function will never be called. |