Skip to content

Instantly share code, notes, and snippets.

View julienba's full-sized avatar

julien bille julienba

View GitHub Profile
@julienba
julienba / specs.scala
Created July 22, 2012 18:16 — forked from teamon/specs.scala
Scala specs cheatsheet
// === Basics
a must beMatching(bar)
a must be matching(bar)
a must not be matching(bar) // negation
// === Any object
a must_== b
a must_!= b
@julienba
julienba / 1.sql
Created August 28, 2012 10:41 — forked from guillaumebort/1.sql
Play 2.0/Anorm
# --- !Ups
CREATE TABLE users(
email VARCHAR(255) NOT NULL PRIMARY KEY,
name VARCHAR(255)
);
CREATE TABLE subjects(
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
title LONGTEXT NOT NULL,
@julienba
julienba / Article.scala
Created November 7, 2012 14:30 — forked from bmc/Article.scala
One way to do transactions in Play with Anorm
case class Article(...);
object Article {
import DBUtil._
def delete(id: Long): Either[String, Boolean] = {
withTransaction { implicit connection =>
SQL("DELETE FROM comments WHERE article_id = {id}").on("id" -> id).executeUpdate()
SQL("DELETE FROM appusers WHERE id = {id}").on("id" -> id).executeUpdate( )
Right(true)

This post inspired me : http://www.krisbuytaert.be/blog/docker-vs-reality-0-1 !

When people say real world, they actually mean the sick, bitter and desperate world they imagined for you.

So how to produce "ahoy:234" with "ahoy:" and [1,2,3] ??

The idea [1] is "a program is composed of severals one-liners", lets try to port this one liner into several popular languages. :)

EuroClojure 2014, Krakow

Fergal Byrne, Clortex: Machine Intelligence based on Jeff Hawkins’ HTM Theory

  • @fergbyrne
  • HTM = Hierarchical Temporal Memory
  • Slides

big data

  • big data is like teenage sex
    • noone knows how to do it
    • everyone thinks everyone else is doing it

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

defmodule JSON do
import String
def parse( content ) do
case parse_content(content) do
{ value, "" } -> value
{ _, _ } -> raise "crap"
end
end
# define some variables
variable "aws_ubuntu_ami" {
default = "ami-972444ad"
}
variable "aws_keypair" {
default = "xxxx"
}
# AWS account details
$ go install code.google.com/p/go.tools/cmd/vet
go install code.google.com/p/go.tools/cmd/vet: open /usr/local/go/pkg/tool/linux_amd64/vet: permission denied
$ sudo su - root
# GOPATH=/tmp/go /usr/local/go/bin/go get code.google.com/p/go.tools/cmd/cover
# GOPATH=/tmp/go /usr/local/go/bin/go get code.google.com/p/go.tools/cmd/vet
# rm -r /tmp/go
# exit
@julienba
julienba / Dockerfile
Created December 13, 2016 10:48 — forked from ryandotsmith/Dockerfile
EC2 Docker Setup
FROM ubuntu
MAINTAINER "Bobby Wilson"
RUN apt-get update
RUN apt-get install curl -y
RUN cd /usr/local; curl -O http://nodejs.org/dist/v0.10.16/node-v0.10.16-linux-x64.tar.gz
RUN cd /usr/local; tar xzf node-v0.10.16-linux-x64.tar.gz
ENV PATH /usr/local/bin:/usr/sbin:/bin:/usr/local/node-v0.10.16-linux-x64/bin
ADD . /app
EXPOSE 8000:8000
ENV PORT 8000