Skip to content

Instantly share code, notes, and snippets.

@nivertech
nivertech / x
Created November 5, 2013 18:49 — forked from vitaly/x
#!/bin/bash -x
N=$1; shift
if [ -z "$N" -o -z "$1" ]; then
cat <<_
Usage: $0 N COMMAND
_
exit 1
fi
APPDIRS := $(wildcard apps/*)
## Example hack to filter one out:
## APPDIRS := $(filter-out apps/fooapp, $(APPDIRS))
define PROXY_TARGET
$(1):
$(foreach appdir,$(APPDIRS),$(MAKE) -C $(appdir) $(1) ;)
endef
defmodule CommandSigil do
# 'x' is for 'execute'.
defmacro sigil_x({ :<<>>, _line, [string] }, []) when is_binary(string) do
string
|> Macro.unescape_string()
|> String.to_char_list!()
|> :os.cmd()
end
defmodule CommandSigil do
# I chose 't' for 'terminal'. I wanted 'c' for 'command', but it's taken.
def sigil_t(cmd, _opts) do
{ :ok, list } = String.to_char_list(cmd)
:os.cmd(list)
end
end
#!/bin/bash
# Pull this file down, make it executable and run it with sudo
# wget https://raw.github.com/gist/6152521/build-erlang-r16b01.sh
# chmod u+x build-erlang-r16b01.sh
# sudo ./build-erlang-r16b01.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
#!/usr/bin/env bash
if [ $# -ne 2 ]
then
echo "Usage: erl_new <type> <project_name>"
exit 1
fi
TYPE=$1
PROJECT_NAME=$2
1. Go to https://dev.twitter.com/
2. Click on "Sign In" in the upper-right corner.
* There is a link to sign up under the username field if you do not already have a Twitter account.
* If you sign up for a new account, you'll have to confirm your email before you can get an API key.
3. Enter your credentials and sign in.
4. Back at https://dev.twitter.com/, click on your avatar in the upper-right corner, then My Applications.
5. Click on "Create a new application".
6. Fill out the information, agree to the Rules of the Road, do the captcha, and click on "Create your Twitter application".
7. In the application page that comes up next, copy down the "Consumer key" and "Consumer secret". This is half of the key info.
8. Click on "Create my access token" at the bottom of the application page, under "Your access token".
{module, mpegts_alloc}. %% version = 0
{exports, [{module_info,0},{module_info,1},{new,1}]}.
{attributes, []}.
{labels, 7}.
{function, new, 1, 2}.

Each of these commands will run an ad hoc http server in your current directory. Use this power wisely.

Python 2.x

$ python -m SimpleHTTPServer 8000

Python 3.x