Skip to content

Instantly share code, notes, and snippets.

View gre's full-sized avatar
3 cups required

@greweb gre

3 cups required
View GitHub Profile
@gre
gre / EasingFunctions.json
Last active January 11, 2023 10:28
DEPRECATED Please use http://github.com/gre/bezier-easing for latest vrrsion.
{
"ease": [0.25, 0.1, 0.25, 1.0],
"linear": [0.00, 0.0, 1.00, 1.0],
"ease-in": [0.42, 0.0, 1.00, 1.0],
"ease-out": [0.00, 0.0, 0.58, 1.0],
"ease-in-out": [0.42, 0.0, 0.58, 1.0]
}
@gre
gre / nsSMILKeySpline.cpp
Created February 27, 2012 17:39
copy pasted from the Firefox source code - this is how Firefox render CSS Transitions Timing Functions.
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
@gre
gre / README.md
Created February 3, 2012 18:28
SelectorTemplating is a simple CSS-selector-based JavaScript templating.

SelectorTemplating is a simple CSS-selector-based JavaScript templating.

Whereas most templates use inherence, this one is based on "mixin", You can easily mix template fragment each others with the power of CSS selector (like in a CSS file).

It is made for highly modular and loosely coupled JS libraries or applications.

Hence, It perfectly fits the Scalable JavaScript Application Architecture

More infos

@gre
gre / easing.js
Last active April 13, 2025 15:13
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@gre
gre / README.md
Created January 7, 2012 12:30
Grisbi HTML's export stylifier

What?

Grisbi is a personal finance manager http://www.grisbi.org/

This script helps you to make Gribsi HTML report export looking nicer. It only works with "Revenus et dépenses" report mode. (incomes and expenses)

How To

@gre
gre / code.scala
Created December 12, 2011 09:34 — forked from sadache/code.scala
Play20 Promise sequence function
// What is a Promise sequence function ?
// A function which transform a List[Promise[A]] into a Promise[List[A]]
// Usage:
// val list: List[Promise[Int]] = ...
// val sequenced: Promise[List[Int]] = list.sequence() // got it :)
package utils
import play.api.libs.concurrent._
@gre
gre / code.scala
Created December 12, 2011 09:20
Play20 Promise sequence function
// What is a Promise sequence function ?
// A function which transform a List[Promise[A]] into a Promise[List[A]]
// First naive implementation. It's a synchronous implementation (blocking).
def sequencePromises[A](list: List[Promise[A]]): Promise[List[A]] = {
Promise.pure(
list.flatMap(e => e.value match {
case Redeemed(value) => Some(value)
case Thrown(e) => { Logger.debug("thrown "+e); None }
})
@gre
gre / Controller.java
Created October 27, 2011 14:16
Missing feature of Play framework
protected static void redirectToReferer() {
redirect(request.headers.get("referer").values.get(0));
}
@gre
gre / code.less
Created October 26, 2011 16:32
CSS: p.tip for tips
p.tip {
font-style: italic;
padding: 0.5em 1em;
border-left: 2px solid #aaa;
&:before {
content: "Tip: ";
font-weight: bold;
}
}
@gre
gre / code.less
Created October 26, 2011 15:58
Having fun with CSS headers (h1 and h2)
h1 {
&:hover:before {
content: '> ';
}
&:hover:after {
content: ' <';
}
}
h2 {
&:before {