Skip to content

Instantly share code, notes, and snippets.

View allbinmani's full-sized avatar

origo allbinmani

  • Freelance
  • Sweden
View GitHub Profile
@allbinmani
allbinmani / backbone.listenToAnyOnce.js
Created April 20, 2016 12:35
listenToAnyOnce handler for Backbone
/*
* listenToAnyOnce handler for Backbone.[View|Collection|Model]
*
* Call with space separated list of events to listenToOnce, and
* the callback will be called only once any of those events occur.
*
* Usage:
*
* - npm install gist:<this-gist-id>
*
#!/usr/bin/env node
/**
* Crude script to find images that are lingering and/or missing in the docker registry 2.0
*
* Finds all unreferences images in all repos, given the path to the registry-data
* directory (the one that contains 'storage'). Also lists all images that are referenced,
* but are missing on disk.
*
* License: GPL 2.0
#!/bin/sh
# Base system
apt-get update -yq && apt-get upgrade -yq && apt-get dist-upgrade -yq
# WindowManager
apt-get install curl openbox build-essential module-assistant strace -yq
# NodeJS 4.x
curl -sL https://deb.nodesource.com/setup_4.x | bash -
@allbinmani
allbinmani / urlencode.sh
Created February 21, 2016 06:44
urlencode using curl in bash
curl -Gso /dev/null -w %{url_effective} --data-urlencode @- "" | cut -c 3-