Skip to content

Instantly share code, notes, and snippets.

@nivertech
nivertech / Compile_Bitcoin_on_Ubuntu_12_04.md
Last active August 29, 2015 14:05 — forked from kostaz/Compile_Bitcoin_on_Ubuntu_14_04
Compile Bitcoin on Ubunutu 12.04 LTS
@nivertech
nivertech / app.config
Created August 26, 2014 08:40
how to use colors in lager logs
{lager, [
{handlers, [
{lager_console_backend, notice},
{lager_file_backend, [{file, "log/error.log"}, {level, error}]},
{lager_file_backend, [{file, "log/console.log"}, {level, info}]}
]},
{crash_log, "log/crash.log"},
{colored, true},
{colors, [
{debug, "\e[0;38m" },
var child_process = require('child_process');
exports.handler = function(event, context) {
var proc = spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' });
proc.on('close', function(code){
if(code !== 0) {
return context.done(new Error("Process exited with non-zero status code"));
}
{
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",

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 / 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
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 / 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 / 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) ->
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"},