Skip to content

Instantly share code, notes, and snippets.

View tdooner's full-sized avatar

Tom Dooner tdooner

View GitHub Profile
@tdooner
tdooner / sagaaaa
Last active August 29, 2015 14:14
elevator saga WIP
{
elevators: [],
floorsWaitingUp: [],
floorsWaitingDown: [],
registerElevator: function(elevator) {
elevator.i = this.elevators.length;
elevator.log = function(msg) {
if (this.i !== 0) { return; }
@tdooner
tdooner / -
Created September 25, 2014 23:44
diff --git a/webpack.config.js b/webpack.config.js
index ff2c436..b779dbc 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,6 +1,7 @@
/* global __dirname:false */
-var webpack = require('webpack');
+var webpack = require('webpack'),
+ exec = require('child_process').exec;
@tdooner
tdooner / redis-failover.rb
Created August 29, 2014 21:23
Redis Sentinel Failover Testing Script
require 'redis'
require 'redis-sentinel'
require 'timeout'
require 'logger'
class TestClient
def initialize
@sentinels = [
{ host: 'sentinel01.example.com', port: 26379 },
{ host: 'sentinel02.example.com', port: 26379 },
@tdooner
tdooner / sidekiq.rb
Last active October 14, 2022 12:12
Sidekiq Redis Sentinel configuration
# config/initializers/sidekiq.rb
Sidekiq.configure_client do |config| # and repeat this inside a Sidekiq.configure_server
config.redis = {
master_name: 'your-master-name',
sentinels: [
"sentinel://sentinel01.example.com:26379",
"sentinel://sentinel02.example.com:26379",
"sentinel://sentinel03.example.com:26379",
],
failover_reconnect_timeout: 20, # roughly 3-5 seconds longer than the sentinel failover-timeout
@tdooner
tdooner / screen_notes.md
Created September 7, 2011 22:04
Lightning Talk - Screen (Terminal Multiplexing)

Terminal Multiplexing and YOU!

Screen gives you a terminal which can persist after your SSH connection has closed.

Reasons to use a terminal multiplexer:

  • Run a lengthy program (crunching, or a Minecraft server, etc.) even after you disconnect.
  • Allows you to resume working exactly where you left off, after your connection breaks or you switch computers.