Skip to content

Instantly share code, notes, and snippets.

View linearregression's full-sized avatar

edwardttril linearregression

  • San Francisco Bay Area, CA
View GitHub Profile
@linearregression
linearregression / gen_rpc.erl
Created December 2, 2015 04:17 — forked from maxlapshin/gen_rpc.erl
Script to create .c and .h files to generate C structs read/write code from .hrl description
#!/usr/bin/env escript
-mode(compile).
-record(gen, {
module,
enums = [],
structs = [],
aliases = [],
@linearregression
linearregression / gist:7c4a94f8f1693457d553
Created November 30, 2015 01:47
Who's hiring 2015-05 jobs for emerging languages
https://news.ycombinator.com/item?id=9812245
Go:
Meta https://news.ycombinator.com/item?id=9815607
Mesosphere https://news.ycombinator.com/item?id=9813131
Schrödinger https://news.ycombinator.com/item?id=9815826
flinc https://news.ycombinator.com/item?id=9817310
Second Spectrum https://news.ycombinator.com/item?id=9812647
Collective Health https://news.ycombinator.com/item?id=9812298
Umbel https://news.ycombinator.com/item?id=9813267
@linearregression
linearregression / Documentation.md
Created November 18, 2015 21:39 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@linearregression
linearregression / guard_helpers.ex
Created November 15, 2015 04:03 — forked from christhekeele/guard_helpers.ex
A defguard macro written for Elixir v0.11.something a while back. I don't remember anything breaking at the time. Written for a library that was supposed to help AST transformations, in part by creating guards for particular AST constructs.
defmodule Guard.Helpers do
@moduledoc """
Tools for creating custom guards.
"""
@doc """
Creates a macro that's aware of its presence in a guard.
Taken from https://github.com/elixir-lang/elixir/blob/master/lib/elixir/lib/kernel.ex#L1601,
@linearregression
linearregression / heaps.erl
Created November 3, 2015 06:06 — forked from larsmans/heaps.erl
Priority queues (pairing heaps) in Erlang
% Copyright (c) 2010-2014, Lars Buitinck
% May be used, redistributed and modified under the terms of the
% GNU Lesser General Public License (LGPL), version 2.1 or later
% Heaps/priority queues in Erlang
% Heaps are data structures that return the entries inserted into them in
% sorted order. This makes them the data structure of choice for implementing
% priority queues, a central element of algorithms such as best-first/A*
% search and Kruskal's minimum-spanning-tree algorithm.
@linearregression
linearregression / observer.md
Last active September 7, 2015 15:30 — forked from pnc/observer.md
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host

Github Events Analysis with Neo4j

Imgur

On July 22, Github announced the 3rd Annual Github Data Challenge presenting multiple sources of data available.

This sounded to me a good opportunity to use their available data and import it in Neo4j in order to have a lot of fun at analyzing the data that fits naturally in a graph.

As I work mainly offline or behind military proxies that do not permit me to use the ReST API, I decided to go for the Github Archive available here, you can then download json files representing Github Events on a daily/hour basis.

BEAM

assemble

$ erlc -S test.erl
git clone <repo-address>
git tag -l
git checkout <tag-name>
git branch -D master
git checkout -b master
{
"AWSTemplateFormatVersion":"2010-09-09",
"Description":"Start up a parallel Bioconductor cluster with ssh access. **WARNING** This template creates Amazon EC2 instances. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters":{
"BiocVersion" : {
"Description" : "Bioconductor Version. 2.11 is recommended.",
"Type" : "String",
"Default": "2.11",
"AllowedValues": ["2.11"],
"ConstraintDescription": "Must be 2.11"