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
#!/bin/bash | |
namespace="" | |
deployment="" | |
function getCurrentPods() { | |
# Retry up to 5 times if kubectl fails | |
for i in $(seq 5); do | |
current=$(kubectl -n $namespace describe deploy $deployment | \ | |
grep desired | awk '{print $2}' | head -n1) |
#!/bin/bash | |
# https://gist.github.com/jgamblin/9701ed50398d138c65ead316b5d11b26 | |
# launchctl start com.user.slack-spotify | |
# Get it from here : https://api.slack.com/custom-integrations/legacy-tokens | |
APIKEY="" | |
trap onexit INT |
/****************************************************************************** | |
Copyright (c) 2015 Particle Industries, Inc. All rights reserved. | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public | |
License as published by the Free Software Foundation, either | |
version 3 of the License, or (at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
def encodeAsFirebaseKey(self, string): | |
return string.replace(".", '%P') \ | |
.replace("#", '%H') \ | |
.replace("$", '%D') \ | |
.replace("/", '%S') \ | |
.replace("[", '%OB') \ | |
.replace("]", '%CB') | |
def decodeAsFirebaseKey(self, string): | |
return string.replace("%P", '.') \ |
function encodeAsFirebaseKey(string) { | |
return string.replace(/\%/g, '%25') | |
.replace(/\./g, '%2E') | |
.replace(/\#/g, '%23') | |
.replace(/\$/g, '%24') | |
.replace(/\//g, '%2F') | |
.replace(/\[/g, '%5B') | |
.replace(/\]/g, '%5D'); | |
}; |
date +%s | shasum | base64 | head -c 32 ; echo |
// Allow from any origin | |
if (isset($_SERVER['HTTP_ORIGIN'])) { | |
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); | |
header('Access-Control-Allow-Credentials: true'); | |
header('Access-Control-Max-Age: 86400'); // cache for 1 day | |
} | |
// Access-Control headers are received during OPTIONS requests | |
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { |
import os | |
print os.urandom(24).encode('hex') |
# coding: utf-8 | |
# Imports | |
import os | |
import cPickle | |
import numpy as np | |
import theano | |
import theano.tensor as T |