Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# this script is intended to run on a debian8 box
set -e
USERNAME=user
_prep () {
apt-get update
#!/usr/bin/env bash
set -euo pipefail # these don't play well with bashdb;
#
## Setup environment
#
: ${GITHUB_USER:=rranelli}
: ${GITHUB_API_TOKEN:=$(mimipass get github-api-token)}
: ${CODE_DIR:=$HOME/code}
@rranelli
rranelli / braindump-7langs-7weeks.org
Created March 2, 2015 23:42
braindump-7langs-7weeks

Talk

Why is it important to learn new languages ?

<Image of the pragmatic programmer book>. You should learn a new language every year because they bend your mind and teach you new ways too solve old problems.

Also, the fact of the language being new is not actually all that important. What is important is that the language has another paradigm and another way o seeing the world.

***** Ideas from [[http://vimeo.com/91672848][this talk]]:
In the small, its easy to apply solid and stuff.
How should we be using this ?????
=> its terribly easy to write procedural code using object oriented languages.
=> OO is a method to:
control the intellectual load of understand our systems.
extensible, reusable, simpler
# -*- restclient -*-
:token := "<your secret private token>" # This is the gitlab authentication token
# Groups
:page := 1
GET https://<gitlabhost>/api/v3/groups?private_token=:token&page=:page
# Group
:group := 42
@rranelli
rranelli / clone_repos.rb
Last active August 29, 2015 14:03
Clone all your gitrepos
#!/usr/bin/env ruby
require 'net/http'
require 'json'
include Process
def get_all_repos_from_user(username, protocol = 'ssh')
repos = get_response(username)
get_urls(repos, protocol)
public class ClassWithMethodMissing : DynamicObject {
public override bool TrySetMember(SetMemberBinder binder, object value) {
_dictionary[binder.Name] = value;
return true;
}
public override bool TryGetMember(GetMemberBinder binder,
out object result) {
return _dictionary.TryGetValue(binder.Name, out result);
}
(* Fsharp files must contain a module definition, which is equivalent to a namespace *)
module FsharpHighlights
#light
(* The open statement is equivalent to c#'s using and vb's imports *)
open System
(* Functions are first class citizens ;D *)
let square x = x * x
let numbers x = [1..x]