Skip to content

Instantly share code, notes, and snippets.

View LucaColonnello's full-sized avatar
👋
Come say hello on Twitter!

Luca Colonnello LucaColonnello

👋
Come say hello on Twitter!
View GitHub Profile
@LucaColonnello
LucaColonnello / languages.json
Created December 11, 2015 11:25 — forked from abiank/languages.json
languages.json
/**
* @author Phil Teare
* using wikipedia data
*/
isoLangs = {
"ab":{
"name":"Abkhaz",
"nativeName":"аҧсуа"
},
"aa":{
@LucaColonnello
LucaColonnello / MDN_Languages.js
Created December 11, 2015 10:59 — forked from ethertank/MDN_Languages.js
MDN_Languages
var MDN_Languages_AlphabetOrder = {
"ar" : "عربي",
"ca" : "català",
"cs" : "Čeština",
"de" : "Deutsch",
"el" : "Ελληνικά",
"en-us" : "English (US)",
"es" : "Español",
"fa" : "فارسی",
"fi" : "suomi",
@LucaColonnello
LucaColonnello / README.markdown
Created December 11, 2015 10:56 — forked from marijn/README.markdown
List of nationalities in YAML, CSV and TXT format

List of nationalities

It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.

##List of countries

I've also compiled a list of countries

@LucaColonnello
LucaColonnello / README.markdown
Created December 11, 2015 09:22 — forked from marijn/README.markdown
List of countries in YAML, CSV and TXT format

#List of countries

It's time someone compiled a list of countries to use within a web application. This gist attempts to make a first move at that.

List of nationalities

I've also compiled a list of nationalities

@LucaColonnello
LucaColonnello / INSTALLATION.md
Created October 5, 2015 08:44 — forked from DenisIzmaylov/INSTALLATION.md
OS X 10.11 El Capitan: fresh install with Node.js (io.js) Developer Environment

OS X 10.11 (El Capitan) / Node.js and io.js Developer Environment

Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.

Content

@LucaColonnello
LucaColonnello / App-test.js
Created August 23, 2015 09:36
React Test BDD with Mocha and JSDom
// components/App-test.jsx
import "../utils/test/dom";
import assert from 'assert';
import React from 'react/addons';
import App from '../App';
const TestUtils = React.addons.TestUtils;
@LucaColonnello
LucaColonnello / create-component.js
Last active August 29, 2015 14:27
createComponent module for use with React shallow rendering
import React from 'react/addons';
const TestUtils = React.addons.TestUtils;
export default createComponent;
function createComponent(component, props, ...children) {
const shallowRenderer = TestUtils.createRenderer();
shallowRenderer.render(React.createElement(component, props, children.length > 1 ? children : children[0]));
return shallowRenderer.getRenderOutput();
}
@LucaColonnello
LucaColonnello / index.js
Last active October 16, 2015 09:50
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var patchHTML = require('html2idom').patchHTML;
function cond( cond, resTrue, resFalse ) {
if(cond){
return resTrue;
} else {
return resFalse;
@LucaColonnello
LucaColonnello / HTTPInterface.js
Last active August 31, 2017 17:23
Loopback React SDK Proposals
// it could be part of the LoopBackSDK module
// evaluate usage of node http module for ajax call
var http = require( 'http' );
// LoopBack HTTP Interface
// Class that has the responsibility to call
// the LoopBack Application, must be instantiated for each models
function HTTPInterface(
// Cross browser, backward compatible solution
(function( window, Date ) {
// feature testing
var raf = window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.oRequestAnimationFrame;
window.animLoop = function( render, element ) {
var running, lastFrame = +new Date;