Skip to content

Instantly share code, notes, and snippets.

View azappa's full-sized avatar
💭
🍣

Alessio Zappa azappa

💭
🍣
View GitHub Profile
@azappa
azappa / humanize-duration-custom
Created April 1, 2014 08:55
humanize milliseconds to a readable output (en/it)
/*
-- original --
HumanizeDuration.js
http://git.io/j0HgmQ
-- edit --
* remove unused languages
* added Italian
* return type
@azappa
azappa / twitterFetcherPanda.js
Created September 2, 2014 08:45
Customize twitterFetcher JS lib for our needs (e.g. custom templating output).
/*********************************************************************
### Edit by azappa/emanbrivio ###
+ Now it outputs a javascript array of objects so you can stylize how you want output code
+ Less parameters in config:
* widget id (required)
* callback function for visualizing tweets (required)
* maxTweets (optional)
* lang (optional)
+ You can format date by using some library like Moment.js (http://momentjs.com/) or native JS Date functions
@azappa
azappa / dropzone.jade
Created October 16, 2014 10:38
Dropzone Test
doctype html
html
head
title Dropzone Test
meta(charset='utf-8')
meta(name='viewport', content='width=device-width, initial-scale=1.0')
style(type='text/css')
:stylus
#uploadWebsite
@azappa
azappa / gist:0f490a0d621a9e0b2011
Created April 30, 2015 10:05
fix clear cache for prismic.io < 1.1.4

In app.js after routes:

app.route('/api/clear').get(routes.clearcache);

In routes/index.js

exports.clearcache = prismic.route(function(req, res, ctx) {
  ctx.api.apiCache.clear(function () {

res.end(JSON.stringify({'cleared': 'ok'}, null, 2));

@azappa
azappa / viaggiatreno_stations
Created July 16, 2015 13:06
Italian railway stations
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name":"Abano Terme","id_staz":"S05700","id_reg":12},"geometry":{"type":"Point","coordinates":[11.811533,45.355199]}},{"type":"Feature","properties":{"name":"Abbadia Lariana","id_staz":"S01416","id_reg":1},"geometry":{"type":"Point","coordinates":[9.335175,45.895864]}},{"type":"Feature","properties":{"name":"Abbasanta","id_staz":"S12873","id_reg":20},"geometry":{"type":"Point","coordinates":[8.817733,40.128801]}},{"type":"Feature","properties":{"name":"Abbiategrasso","id_staz":"S01062","id_reg":1},"geometry":{"type":"Point","coordinates":[8.921305,45.400631]}},{"type":"Feature","properties":{"name":"Acate","id_staz":"S12409","id_reg":14},"geometry":{"type":"Point","coordinates":[14.42545,36.996592]}},{"type":"Feature","properties":{"name":"Acciano","id_staz":"S07423","id_reg":19},"geometry":{"type":"Point","coordinates":[13.711345,42.175994]}},{"type":"Feature","properties":{"name":"Acerra","id_staz":"S09215","id_reg":18},"geometry":{"typ
@azappa
azappa / output.rb
Created October 12, 2013 09:19
For earthquake (gem install earthquake), simple terminal Twitter app. Fixed output for retweets or reply nickname (installed version doesn't output correct values for me)
# encoding: UTF-8
require 'stringio'
module Earthquake
module Output
def output_filters
@output_filters ||= []
end
def output_filter(&block)
@azappa
azappa / vendor.styl
Created October 24, 2013 14:11
vendor.styl for nib (put it in nib folder) which remove normalize functions in transitions and elsewhere maybe
@import 'config'
/*
* Alias "nowrap" as "no-wrap".
*/
no-wrap = unquote('nowrap')
/*
* Helper to find out if a given value is a width
@azappa
azappa / CDVViewController.m
Created November 4, 2013 12:00
Phonegap Fix for iOS7 Keyboard
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
@azappa
azappa / Jade.sublime-build
Created January 7, 2014 19:02
Jade Build for Sublime Text 2/3 - put me in Packages/User (obviously previously install jade globally with npm install -g jade)
{
"path": "$HOME/bin:/usr/local/bin:$PATH",
"cmd": ["jade", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.jade"
}
@azappa
azappa / Package Control.sublime-settings
Last active February 9, 2016 19:22
Sublime Text 3 personal user preferences
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"Babel",
"Colorsublime",
"Jade",