Skip to content

Instantly share code, notes, and snippets.

View lucca65's full-sized avatar

Julien Lucca lucca65

View GitHub Profile
@aptinio
aptinio / factory.ex
Created February 9, 2018 09:25
Roll your own factory for Ecto
defmodule Foo.Factory do
alias Foo.Blog.{Post, Comment}
def params_for(Post) do
%{
title: Faker.Lorem.sentence(),
body: Faker.Lorem.paragraph()
}
end
defmodule MonadError do
defmacro __using__(_) do
quote do
import MonadError, only: [bind: 1, fail: 1, fail: 0, with: 3, either: 3, sandbox: 1]
require MonadError
end
end
defmacro sandbox(body) do
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 8, 2024 07:49
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@redinger
redinger / Emacs.md
Created November 26, 2011 03:22
Setting up Emacs daemon on OS X

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Cocoa Emacs

Download the latest pretest version of [Emacs for Mac OS X]: http://emacsformacosx.com/builds