Skip to content

Instantly share code, notes, and snippets.

@krukru
krukru / wait-for-healthy.sh
Created July 23, 2018 16:32
Wait until docker container is healthy
#!/usr/bin/env bash
CONTAINER_HEALTH=$(docker inspect --format='{{json .State.Health.Status}}' $1)
if [ -z $CONTAINER_HEALTH ]; then
echo "Container not found"
exit 1
fi;
until test $CONTAINER_HEALTH = "\"healthy\""; do
echo "Waiting..."
@HamptonMakes
HamptonMakes / RBResizer.swift
Created June 27, 2014 14:45
Swift Image Resizer
//
// RBResizer.swift
// Locker
//
// Created by Hampton Catlin on 6/20/14.
// Copyright (c) 2014 rarebit. All rights reserved.
//
import UIKit
@lrvick
lrvick / bitcolor.js
Created March 18, 2012 20:02
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){