Skip to content

Instantly share code, notes, and snippets.

View idmontie's full-sized avatar

Ivan Montiel idmontie

View GitHub Profile
@idmontie
idmontie / color-swatches.css
Created July 27, 2015 18:37
Few color swatches
#swatches .swatch {
float:left;
width:100px;
height:100px;
}
@idmontie
idmontie / monad-example.js
Created August 30, 2015 16:35
Monad example in JavaScript
var cube = function ( x ) { return [x * x * x, "Cube was called"]; };
var square = function ( x ) { return [x * x, "Square was called"]; };
var compose = function ( f, g ) { return function ( a ) { return f( g( a ) ); }; };
var Debuggable = function ( f ) {
return function ( debugInfo ) {
var x = debugInfo[0],
s = debugInfo[1],
@idmontie
idmontie / color-time.html
Created September 14, 2015 03:32
Color Time
<html>
<head>
<style>
#time {
width: 300px;
height: 40px;
margin: 10px auto;
padding: 30px;
font-family: verdana;
@idmontie
idmontie / long-polling.jquery.js
Created September 14, 2015 03:39
Long Polling for jQuery
/* Long Polling
*
* By: Ivan Montiel
*/
jQuery.poll = function (options, poll) {
if ( poll == null || poll === undefined) {
poll = {};
}
@idmontie
idmontie / jasmine-phaser-matcher.js
Created September 14, 2015 22:46
Jasmine Phaser Matcher
this.game.stage.children <-- array of objects
this.game.stage.children[0] <-- object with children as array of object
this.game.stage.children[0].children <--- array of objects
expect( this.game.stage ).has( Phaser.TEXT ).withText( 'Take That, Robot!' );
expect( this.game.stage ).has( Phaser.BUTTON ).has( 'text' ).withText( 'Play' );
@idmontie
idmontie / ideas-for-global-game-jam.md
Last active January 30, 2016 06:21
Ideas for Global Game Jam
@idmontie
idmontie / !meteor-demo.md
Last active January 6, 2016 17:24
Meteor Demonstration

Demonstration files for Meteor.

@idmontie
idmontie / _README.md
Created February 22, 2016 15:18
It's like x for y

It's like X for Y generator

@idmontie
idmontie / SimpleLoanCalculator.md
Last active July 11, 2020 18:28
Simple Loan Calculator

Simple loan calulator, just run in the browser

@idmontie
idmontie / inject.js
Created June 6, 2016 21:55
Simple function injection
export default function inject() {
const args = [...arguments];
const toCall = args[0];
const toInject = args.slice(1, args.length);
const shouldInject = inject.should === false ? false : true;
if (shouldInject) {
return function () {
const combinedArgs = [...toInject, ...arguments];