Skip to content

Instantly share code, notes, and snippets.

View ojacquemart's full-sized avatar

Olivier Jacquemart ojacquemart

View GitHub Profile
@loicdescotte
loicdescotte / iteratees_humains.md
Last active October 10, 2015 17:47
Play2 : Les Iteratees expliqués aux humains... francophones!

#Play2 : Les Iteratees expliqués aux humains... francophones!

Disclaimer : Ce qui suit est la traduction d'un article anglophone paru sur le blog mandubian.com

Vous pouvez retrouver l'article original ici

Vous avez probablement remarqué une nouvelle fonctionnalité intrigante de Play2 nommée Iteratee (ainsi que ses compagnons Enumerators et Enumeratee). Le but de cet article est d'essayer de rendre le concept d'Iteratee compréhensible pour le plus grand nombre avec des arguments simples, en évitant l'approche mathématique / fonctionnelle.

Cet article ne prétend pas tout expliquer à propos des Iteratee / Enumerator / Enumeratee mais traite plutôt les idées qui se cachent derrière.

@xcambar
xcambar / LICENSE
Last active November 20, 2015 12:57
Authenticated routing using AngularJS
Copyright (c) 2015 - Xavier Cambar <@ xcambar_gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@loicdescotte
loicdescotte / Forcomptran.md
Last active November 12, 2025 15:54
Scala for comprehension translation helper

Scala for comprehension translation helper

"For comprehension" is a another syntaxe to use map, flatMap and withFilter (or filter) methods.

yield keyword is used to aggregate values in the resulting structure.

This composition can be used on any type implementing this methods, like List, Option, Try, Future...

object Money {
// Equation: x = 1*foo + 7*bar + 11*qix + 21*bar
val FOO = 1; val BAR = 7; val QIX = 11; val BAZ = 21;
def change(cents: Int): List[Map[String, Int]] = {
lazy val tuple = for (
foo <- 0 to cents; bar <- 0 to (cents - FOO * foo) / BAR;
qix <- 0 to (cents - FOO * foo - BAR * bar) / QIX;
baz <- 0 to (cents - FOO * foo - BAR * bar - QIX * qix) / BAZ
) yield (foo, bar, qix, baz)
Stream(tuple: _*)
@fsarradin
fsarradin / WebMain.java
Last active December 12, 2015 03:48
Two ways to create a basic Web application from scratch with route management (in Scala and in Java 8)
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpServer;
import java.io.IOException;
import java.net.InetSocketAddress;
public class WebMain {
public static void main(String[] args) throws IOException {
WebServer.serve(8080, "/").withRoute(
@gsoltis
gsoltis / RxFirebase.java
Last active May 6, 2024 03:16
RxJava Bindings for Firebase
package com.firebase.client;
import com.firebase.client.core.Constants;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.functions.Func1;
import rx.subscriptions.Subscriptions;
public class RxFirebase {
@staltz
staltz / introrx.md
Last active November 19, 2025 07:55
The introduction to Reactive Programming you've been missing
@robertmarsal
robertmarsal / gist:9feaa9150926efa4175a
Created December 17, 2014 21:09
Install f.lux on Ubuntu 14.10
sudo apt-get install python-glade2 python-appindicator
git clone https://github.com/Kilian/f.lux-indicator-applet.git
cd f.lux-indicator-applet
chmod +x setup.py
sudo ./setup.py install
fluxgui
@jewelia
jewelia / gist:595200aae5f9a437a634
Last active August 29, 2015 14:12
Books: 2014 retrospective and to-read for 2015

Many of my friends have shared their reading lists of all the books they read in 2014 (thank you!) -- this gave me some excellent ideas of books to read for 2015.

So I have decided to share my reading list as well, and the list of books I plan to read in 2015. If you have any ideas for additional books, I'd love them (especially in the topic areas of business, finance, nonfiction).

Favorite books I read in 2014:

  • The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers by Ben Horowitz
  • The Everything Store: Jeff Bezos and the Age of Amazon by Brad Stone
  • The Effective Executive: The Definitive Guide to Getting the Right Things Done by Peter F Drucker
  • Zero to One: Notes on Startups, or How to Build the Future by Peter Thiel
@ericelliott
ericelliott / essential-javascript-links.md
Last active June 14, 2025 18:43
Essential JavaScript Links