Skip to content

Instantly share code, notes, and snippets.

View loretoparisi's full-sized avatar
🐍
Pythoning

Loreto Parisi loretoparisi

🐍
Pythoning
View GitHub Profile
@nhagen
nhagen / PromisAllWithFails.js
Last active December 23, 2025 06:42
Wait until all promises have completed even when some reject, with Promise.all
var a = ["sdfdf", "http://oooooolol"],
handleNetErr = function(e) { return e };
Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr))
.then(function(sdf, invalid) {
console.log(sdf, invalid) // [Response, TypeError]
})
.catch(function(err) {
console.log(err);
})
@telekosmos
telekosmos / uniq.js
Last active December 26, 2025 08:37
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
@DarrenN
DarrenN / get-npm-package-version
Last active June 20, 2025 19:20 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active July 20, 2026 19:56
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@mbejda
mbejda / Band or Organization
Created October 18, 2015 16:44
Organization or Band Trained Dataset
BAND We are Paramore.
BAND Real bands save fans real fans save bands. If I don't follow you back i'd be glad to, just ask :) ♡personal account : @AllTimeFool♡
BAND New concert film & live album, Ghost Stories Live 2014, out now. CD/DVD/Blu-ray http://smarturl.it/Live2014  iTunes http://smarturl.it/Live2014iTunes 
BAND we're all fan girls at heart, this is the place to be for the most relatable tweets commonbandbusiness@gmail.com
BAND The Official Twitter of THE BAND PERRY. New single LIVE FOREVER on iTunes: http://smarturl.it/TBPLiveForever 
BAND bands according to tumblr // tw: @jordancatalano
BAND Band Of Horses 'Acoustic At The Ryman' Out Now: http://smarturl.it/bohaatrit 
BAND The Official Twitter profile for Incubus.
BAND Our Twitter run by the band and crew to give you an inside look into our lives on the road. Get #FutureHearts now: http://smarturl.it/futurehearts 
BAND Official Twitter feed for all things Rock Band®. Start a Band. Rock the World.
- (void)saveWebDataInternal:(TaxiSpecialPlacesHierarchyResponseModel *)data completion:(void(^)(NSArray *))completion
{
        NSBlockOperation *op = [[NSBlockOperation alloc] init];

        op.completionBlock = ^{
            dispatch_async(dispatch_get_main_queue(), ^{
                [self loadCachedDataInternal:completion];
            });
 };
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rndomhack
rndomhack / amznMusic.js
Last active January 18, 2019 17:31
Amazon Prime Music Download Bookmarklet
javascript:(() => {
function download(uid) {
var url = "";
var metadata = null;
return new Promise((resolve, reject) => {
amznMusic.data.getServerSongForPlayer(result => {
if (!result) {
reject();
return;
@loretoparisi
loretoparisi / README
Created March 6, 2016 23:11
netflix-prize
SUMMARY
================================================================================
This dataset was constructed to support participants in the Netflix Prize. See
http://www.netflixprize.com for details about the prize.
The movie rating files contain over 100 million ratings from 480 thousand
randomly-chosen, anonymous Netflix customers over 17 thousand movie titles. The
data were collected between October, 1998 and December, 2005 and reflect the
distribution of all ratings received during this period. The ratings are on a
@stonehippo
stonehippo / docker_x11_gui_osx.md
Last active March 18, 2025 02:28
Getting X11 GUI applications to work on OS X with Docker

Getting X11 GUI applications to work on OS X with Docker

$ brew install socat
$ brew cask install xquartz <--- assuming you don't already have XQuartz installed some other way
$ open -a XQuartz <--- start an XQuartz session

$ socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"