Skip to content

Instantly share code, notes, and snippets.

@datacarl
datacarl / iptableflip.sh
Created January 8, 2016 23:11 — forked from lewisd32/iptableflip.sh
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@datacarl
datacarl / gist:7029558
Created October 17, 2013 18:09
Throttle method that is triggered by user scroll.
var scheduled = false,
_throttleDelay = 200;
function ScrollHandler(e) {
//throttle event:
if (!scheduled) {
scheduled = true;
setTimeout(function () {
console.log('scroll');
@datacarl
datacarl / gist:6688180
Created September 24, 2013 17:23
Problems accessing this when using prototypal pattern for prototypal inheritance.
var transition = {
create: function() {
// Assign to self, but this will only be accessible inside the create function.
var self = Object.create(this);
self.circle = new Kinetic.Circle({
x: 10,
y: 10,
});
self.start();