Skip to content

Instantly share code, notes, and snippets.

View willywongi's full-sized avatar

Francesco Pongiluppi willywongi

View GitHub Profile
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
@willywongi
willywongi / .gitignore
Last active August 29, 2015 14:03 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
@willywongi
willywongi / index.js
Created March 25, 2015 10:48
Function returning the same promise as long it's not fullfilled/rejected.
function getSomething() {
/**
* Returns a promise that fullfills in 15 seconds
**/
if (getSomething._promise) {
return getSomething._promise;
} else {
return getSomething._promise = new Promise(function(resolve, reject) {
setTimeout(function() {
getSomething._promise = null;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Checkbox personalizzate</title>
<style>
#custom_checkbox input[type=checkbox] { display: none; }
#custom_checkbox label { padding-left: 20px; background-position: 0px center;
background-repeat: no-repeat; cursor: pointer; }
@willywongi
willywongi / conan.js
Created March 29, 2011 13:36
arbitrary arguments length object constructor, in Javascript
function CONAN(cls) {
/* Arbitrary Number of Arguments Object Constructor,
ANAOC
but everyone calls him
CONAN
CONAN takes a Object Constructor and adds a static method named "build", whose only
argument is an array that get passed to the Constructor with an apply.
*/
var _helper = function(s) {
cls.apply(this, s);
@willywongi
willywongi / entity.js
Created October 26, 2011 08:04
My own way of playing with the Y.App framework.
/* global YUI=true */
/* Note: the "png" prefix you're seeing through this file is just my own
namespace. No reference to the Portable Network Graphic intended. */
YUI.add('png-entity', function(Y) {
/**
The ContainmentUnit's purposes are: creating Entity extensions, store them and handle
the relations between them.
@class ContainmentUnit
@constructor
@willywongi
willywongi / object-extras.js
Created December 29, 2011 14:02
Return a new object from an array of key/value pairs
/**
* Return a new object from an array of key/value pairs.
* Inspired by the "dict" constructor in python.
*
* @method dict
* @param {Array} arr An array of key/value pairs.
* @return {Object} A new object
* @static
*/
Y.namespace('Object').dict = function(arr) {
@willywongi
willywongi / dabblet.css
Created January 16, 2012 09:27
YouTube Footer Buttons
/*
YouTube Footer Buttons
*/
.button {
border: 1px solid #DDD;
border-radius: 3px;
text-shadow: 0 1px 1px white;
box-shadow: 0 1px 1px #fff;
font: bold 11px Sans-Serif;
@willywongi
willywongi / each_with_index.coffee
Created September 18, 2012 11:47 — forked from burin/each_with_index.coffee
each_with_index handlebars helper, adds an {{index}} prop accessible from within the block
Handlebars.registerHelper 'each_with_index', (array, fn) ->
buffer = ''
for i in array
item = i
item.index = _i
buffer += fn(item)
buffer
@willywongi
willywongi / index.html
Last active December 27, 2017 09:47
This is actually a test
<!DOCTYPE html>
<html class="ynap-fe-exercise" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
<link href="index.css" rel="stylesheet">
<script src="index.js"></script>
<script id="ynap-news-story-tmpl" type="text/x-template">