Skip to content

Instantly share code, notes, and snippets.

View meandavejustice's full-sized avatar

Dave Justice meandavejustice

View GitHub Profile
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@magegu
magegu / multipart.js
Last active July 11, 2023 20:12
mutipart upload for aws s3 with nodejs based on the async lib including retries for part uploads
/*
by Martin Güther @magegu
just call it:
uploadFile(absoluteFilePath, callback);
*/
var path = require('path');
var async = require('async');
@jaredhirsch
jaredhirsch / ugh.js
Last active January 15, 2016 19:34
loading code in one addon from another addon
// skipping the imports of Cu and AddonManager here:
// get an addon pointer
var addon;
AddonManager.getAddonByID('@idea-town-addon', function(x) { addon = x; });
// get the local machine's file path of the addon
var addonURI = addon.getResourceURI().asciiSpec;
// ugh, wrap the `file:///` URI in a `jar:///` URI,
// to get access to the metrics.jsm file inside the zipped idea town xpi.
// figured this out after a long search in dxr:
@bishboria
bishboria / springer-free-maths-books.md
Last active September 17, 2024 05:30
Springer made a bunch of books available for free, these were the direct links
@dlmanning
dlmanning / toolbar.js
Last active December 16, 2015 01:31
How I make react components without react
import Icon from 'react-fa'
import hoverable from 'lib/hocs/hoverable'
import instyled, { flatKeyed } from 'instyled'
import cascade from 'cascade'
export const EditButton = hoverable(
instyled(
flatKeyed(
cascade({
position: 'absolute',
@Noitidart
Noitidart / _ff-addon-snippet-playSound.js
Created August 20, 2015 03:22
_ff-addon-snippet-playSound - Trying to use Audio API to play sound.
function audioContextCheck() {
if (typeof Services.appShell.hiddenDOMWindow.AudioContext !== 'undefined') {
return new Services.appShell.hiddenDOMWindow.AudioContext();
} else if (typeof Services.appShell.hiddenDOMWindow.mozAudioContext !== 'undefined') {
return new Services.appShell.hiddenDOMWindow.mozAudioContext();
} else {
throw new Error('AudioContext not supported');
}
}
@stfnhh
stfnhh / share.sh
Last active November 1, 2022 02:20
Command line interface for file.io
#!/bin/bash
WEEKS=0
ENCRYPTION=false
FILE=$1
usage() {
cat <<EOF
Usage: $0 FILE [options]
@staltz
staltz / introrx.md
Last active September 20, 2024 10:10
The introduction to Reactive Programming you've been missing
;; Very quick hack to use `grasp` for searching js tokens in emacs.
;; Uses (compile) so when you get search results you can quickly step through them with (next-error) and (previous-error)
;; to install:
;; $ npm install -g grasp strip-ansi
(defun grasp-current-buffer (arg)
(interactive "MGrasp: ")
(compile (concat "grasp -H '" arg "' " (buffer-file-name) " | strip-ansi")))