Skip to content

Instantly share code, notes, and snippets.

View justinmc's full-sized avatar

Justin McCandless justinmc

View GitHub Profile
@justinmc
justinmc / sharing.js
Created October 13, 2014 01:08
A simple example of how to share code between the front and back ends. This file could be run in either environment and work in both, without code duplication.
var config = {
version: '3.1.4'
};
// Frontend
if (window) {
window.config = config;
// Backend
} else if (typeof module !== 'undefined' && module.exports) {
@luvaas
luvaas / addClass, removeClass, and hasClass shims
Last active March 15, 2016 05:11
Jquery extensions that add missing addClass, removeClass, and hasClass shims for SVG elements
//addClass shim for SVG
var originalAddClass = $.fn.addClass;
$.fn.addClass = function(value) {
var orig = originalAddClass.apply(this, arguments);
if(!value) return orig;
for (var i=0; i<this.length; i++ ) {
var elem = this[ i ];
@weblancaster
weblancaster / gist:6e7f43fc02725ce747e224b0c4290906
Last active May 25, 2020 12:53
Kill all container, remove all images and stop all containers
#stop all containers:
docker kill $(docker ps -q)
#remove all containers
docker rm $(docker ps -a -q)
#remove all docker images
docker rmi $(docker images -q)