Skip to content

Instantly share code, notes, and snippets.

View AlexandreBonaventure's full-sized avatar

Alexandre Bonaventure Geissmann AlexandreBonaventure

View GitHub Profile
@psobot
psobot / jquery.punchout.js
Created December 16, 2012 19:03
Punching out text with HTML5 canvas
// Some really hacky code being used in my next blog redesign.
// by Peter Sobot (psobot.com) on December 16, 2012
;(function ( $, window, document, undefined ) {
var pluginName = 'punchout',
defaults = {
};
function Plugin( element, options ) {
this.element = element;
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@staltz
staltz / introrx.md
Last active May 9, 2025 12:50
The introduction to Reactive Programming you've been missing
@bastiankoetsier
bastiankoetsier / eloquent-join.php
Created July 6, 2015 11:23
Forces eloquent to join tables instead of eager-loading. useful for filtering & orderin
/**
* @param $query
* @param $relation_name
* @param string $operator
* @param string $type
* @param bool $where
* @return mixed
*/
public function scopeModelJoin($query, $relation_name, $operator = '=', $type = 'left', $where = false)
{
@function up-to($list, $index) {
$l: ();
@each $e in $list {
@if length($l) < $index {
$l: append($l, $e, list-separator($list));
}
}
@return $l;
}
@mjackson
mjackson / app.js
Created December 29, 2015 05:07
Using webpack with pixi.js
var PIXI = require('pixi.js')
console.log(PIXI)

From zero to microservice with 𝚫 now

The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.

It uses Open Source tools that are widely available, tested and understood:

  • Node.JS
  • NPM
  • Express
@devodo
devodo / gist:8b39748d65e8185fbd89
Created March 16, 2016 11:43
PostgreSQL create UUID max aggregate function
CREATE OR REPLACE FUNCTION max (uuid, uuid)
RETURNS uuid AS $$
BEGIN
IF $1 IS NULL OR $1 < $2 THEN
RETURN $2;
END IF;
RETURN $1;
END;
$$ LANGUAGE plpgsql;
@wclr
wclr / cycle-state-ramda.md
Last active April 6, 2018 15:06
A way to handle state in cycle.js

A way to handle state in cycle.js

Simple state management with xstream and ramda, in more transparent fashion than onionify

import * as R from 'ramda'

// first we create factory for making special state stream 
// that will hold our stream value and will be modified with supplied streams of reducers
type StateReducer<T> = (state: T) => T
@only-cliches
only-cliches / pixibackground.js
Last active March 27, 2025 19:39
PixiJS Background Cover & Background Container
/*
* PixiJS Background Cover/Contain Script
* Returns object
* . {
* container: PixiJS Container
* . doResize: Resize callback
* }
* ARGS:
* bgSize: Object with x and y representing the width and height of background. Example: {x:1280,y:720}
* inputSprite: Pixi Sprite containing a loaded image or other asset. Make sure you preload assets into this sprite.