Skip to content

Instantly share code, notes, and snippets.

@hyle
hyle / getagist.py
Created July 30, 2011 18:50
fetch files from a public gist
#!/usr/bin/env python
__license__ = 'http://www.opensource.org/licenses/mit-license.php (MIT)'
__author__ = 'Andrea Baresi'
from urllib2 import Request, urlopen
import sys
import json
METADATA_URL = 'http://gist.github.com/api/v1/json/%s'
@hyle
hyle / ko.utils.signatures.js
Last active August 6, 2024 08:17
KnockoutJS utils (ko.utils) signatures
// knockout 2.2.1
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
ko.utils.arrayForEach = function (array, action) { /* .. */ }
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ }
@hyle
hyle / ko.utils.2.3.0.signatures.js
Last active September 25, 2018 09:11
KnockoutJS 2.3.0 utils (ko.utils) signatures
// knockout 2.3.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@hyle
hyle / ko.utils.3.0.0.signatures.js
Created October 25, 2013 13:08
KnockoutJS 3.0.0 utils (ko.utils) signatures
// knockout 3.0.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@hyle
hyle / ko.utils.3.1.0.signatures.js
Created March 5, 2014 08:30
KnockoutJS 3.1.0 utils (ko.utils) signatures
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
ko.utils.arrayForEach = function (array, action) { /* .. */ }
@hyle
hyle / ko.utils.3.3.0.signatures.js
Last active April 9, 2019 13:08
KnockoutJS 3.3.0 utils (ko.utils) signatures
// knockout 3.3.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@hyle
hyle / ko.utils.3.4.0.signatures.js
Last active September 25, 2018 09:12
KnockoutJS 3.4.0 / 3.4.1 / 3.4.2 utils (ko.utils) signatures
// knockout 3.4.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@hyle
hyle / ko.utils.3.5.0.signatures.js
Created September 25, 2018 09:09
KnockoutJS 3.5.0 utils (ko.utils) signatures
// knockout 3.5.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@hyle
hyle / province_italiane_20200821.csv
Created August 21, 2020 09:20
Provinces of Italy
Type Province Capital Code Region Macroregion Population Area Density Comuni President
F *Agrigento* Agrigento AG Sicily Insular 434,870 3,053 144 43 Marcello Maisano (commissioner)
O *Alessandria* Alessandria AL Piedmont North-West 421,284 3,559 119 188 Gianfranco Lorenzo Baldi (R)
O *Ancona* Ancona AN Marche Centre 471,228 1,963 241 47 Liana Serrani (L)
D *Aosta* Aosta AO Aosta Valley North-West 125,666 3,261 39 74
O *Arezzo* Arezzo AR Tuscany Centre 342,654 3,233 106 36 Roberto Vasai (L)
O *Ascoli Piceno* Ascoli Piceno AP Marche Centre 207,179 1,228 170 33 Paolo D'Erasmo (L)
O *Asti* Asti AT Piedmont North-West 214,638 1,510 143 118 Marco Gabusi (R)
O *Avellino* Avellino AV Campania South 418,306 2,792 157 118 Domenico Gambacorta (R)
M *Bari* Bari BA Apulia South 1,251,994 3,821 329 41 Antonio Decaro (L)
@hyle
hyle / regioni_italiane_20200829.csv
Created August 29, 2020 08:23
Regions of Italy
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
Regione,Capoluogo,Popolazione (ab),Superficie (km²),Densità (ab./km²),Province e *città metropolitane*[6],Comuni
Lombardia,Milano,10 103 969,23 864,423,"Bergamo, Brescia, Como, Cremona, Lecco, Lodi, Mantova, *Milano*, Monza e Brianza, Pavia, Sondrio, Varese",1 506
Lazio,Roma,5 865 544,17 232,340,"Frosinone, Latina, Rieti, *Roma*, Viterbo",378
Campania,Napoli,5 785 861,13 671,423,"Avellino, Benevento, Caserta, *Napoli*, Salerno",550
Sicilia,Palermo,4 968 410,25 832,192,"Agrigento, Caltanissetta, *Catania*, Enna, *Messina*, *Palermo*, Ragusa, Siracusa, Trapani",390
Veneto,Venezia,4 907 704,18 345,268,"Belluno, Padova, Rovigo, Treviso, *Venezia*, Verona, Vicenza",563
Emilia-Romagna,Bologna,4 467 118,22 453,199,"*Bologna*, Ferrara, Forlì-Cesena, Modena, Parma, Piacenza, Ravenna, Reggio Emilia, Rimini",328
Piemonte,Torino,4 341 375,25 387,171,"Alessandria, Asti, Biella, Cuneo, Novara, *Torino*, Verbano-Cusio-Ossola, Vercelli",1 181
Puglia,Bari,4 008 296,19 541,205,"*Bari*, Barletta-Andria-Trani, Brindisi, Foggia,