Skip to content

Instantly share code, notes, and snippets.

View Math.uuid.js
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
View rancher docker-compose with mysql
master:
image: rancher/server
container_name: master
volumes_from:
- mysql
ports:
- "8080:8080"
links:
- mysql
environment:
View es6-feature-detection.js
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@sax1johno
sax1johno / Contract Killer 3.md
Created Nov 1, 2016 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@sax1johno
sax1johno / remove-docker-containers.md
Created Aug 2, 2016 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
View remove-docker-containers.md
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
View Chrome Extension Example.js
// Chrome extension button / popup / requester
chrome.tabs.getSelected(null, function(tab) {
chrome.tabs.sendRequest(
tab.id, // id of the tab to send a request to.
{method: "getHighlighted", name: "John"}, // data to send to the tab
function(response) { // function to execute when the tab responds.
if (response.method == 'getHighlighted') {
chrome.setClipboard(response.data); // Something like this.
// response.data contains our highlighted text.
}
You can’t perform that action at this time.