Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
by Martin Güther @magegu | |
just call it: | |
uploadFile(absoluteFilePath, callback); | |
*/ | |
var path = require('path'); | |
var async = require('async'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | |
} | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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"))) |
NewerOlder