Skip to content

Instantly share code, notes, and snippets.

defmodule Episode do
defstruct id: nil, name: nil, video: nil, markdown: nil, post: nil
def get_all do
[
%Episode{id: "001", post: "271", name: "Introduction and Installing Elixir", video: "1366", markdown: "1382"},
%Episode{id: "002", post: "275", name: "Basic Elixir", video: "1367", markdown: "1357"},
%Episode{id: "003", post: "280", name: "Pattern Matching", video: "14879", markdown: "1413"},
%Episode{id: "004", post: "284", name: "Functions", video: "5086", markdown: "1559"},
%Episode{id: "005", post: "298", name: "Mix and Modules", video: "5087", markdown: "1654"},
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Hello World - Google Web Search API Sample</title>
<script src="https://www.google.com/jsapi"
type="text/javascript"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js" ></script>
<script language="Javascript" type="text/javascript">
//<!
@nivertech
nivertech / hello.erl
Last active August 29, 2015 14:23 — forked from blt/hello.erl
-module(hello).
-export([hello/0]).
hello() ->
[hello(X) || X<-[robert,joe,mike]].
hello(robert) ->
io:format("Hello, Mike.~n");
hello(joe) ->
@nivertech
nivertech / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@nivertech
nivertech / gist:8f3e9964168e7cc67c29
Created April 1, 2015 21:45
missing wx dependencies when building Erlang/OTP 17.5 on Ubuntu 12.04
$:~/Downloads/otp_src_17.5$ ./configure | grep wx
configure: configuring in wx/.
configure: running /bin/bash '/home/zvi/Downloads/otp_src_17.5/lib/wx/./configure' --prefix=/usr/local '--prefix=/usr/local' '--cache-file=/dev/null' '--srcdir=/home/zvi/Downloads/otp_src_17.5/lib' --cache-file=/dev/null --srcdir=/home/zvi/Downloads/otp_src_17.5/lib/wx/.
checking for debug build of wxWidgets... checking for wx-config... /usr/local/bin/wx-config
checking for wxWidgets version >= 2.8.4 (--unicode --debug=yes)... yes (version 3.0.1)
checking for wxWidgets static library... no
checking for standard build of wxWidgets... checking for wx-config... (cached) /usr/local/bin/wx-config
checking for wxWidgets version >= 2.8.4 (--unicode --debug=no)... yes (version 3.0.1)
checking for wxWidgets static library... no
SELECT
pickup_polyId,
SUM(fare_amount)/COUNT(*) AS average_fare,
COUNT(*) AS no_of_trips
FROM
[nyctaximap:dataflow.nyc_output_join_fare_distinct]
WHERE
fare_amount!=0
GROUP BY
pickup_polyId
@nivertech
nivertech / Vagrantfile
Last active August 29, 2015 14:11 — forked from kesor/Vagrantfile
ENV['VAGRANT_NO_PLUGINS'] = 'true'
Vagrant.configure("2") do |v|
v.vm.box = "yungsang/boot2docker"
v.vm.box_version = ">= 1.3.7"
v.vm.box_check_update = false
v.vm.provider "virtualbox" do |vb|
vb.memory = ENV.fetch 'BOX_MEMORY', '1024'
vb.cpus = ENV.fetch 'BOX_CPUS', '1'
vb.functional_vboxsf = false

Docker Workshop

  • This workshop is intended for people who are familiar with Linux and running services like a web server, database, etc.

To make it and easier for everyone, and save us some time please prepare a couple of simple things beforehand. Coming unprepared can cause delays and you might miss the whole workshop because the internet is not fast enough for everyone to download the requirements.

  1. Bring your Laptop - this is a workshop!
    It does not matter which operating system you have installed.
@nivertech
nivertech / aws_signature_v4.py
Created December 15, 2014 12:00
sign AWS Lambda HTTP API request - using AWS Version 4 signature
# AWS Version 4 signing example
# taken from:
# http://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html
# Lambda API (InvokeAsync)
# http://docs.aws.amazon.com/lambda/latest/dg/API_InvokeAsync.html
# See: http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
# This version makes a POST request and passes request parameters
# in the body (payload) of the request. Auth information is passed in
{
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",