Skip to content

Instantly share code, notes, and snippets.

View octplane's full-sized avatar
👨‍💻
I came here for the javascript jokes and was disappointed

Pierre Baillet octplane

👨‍💻
I came here for the javascript jokes and was disappointed
View GitHub Profile
@octplane
octplane / mongo_pubsub.rb
Created November 9, 2010 16:17
Simple Pub/Sub system using MongoDB, capped collections and tailable cursors in ruby
require 'rubygems'
require 'mongo'
module MongoPubSub
QUEUES_COLLECTION = 'queues'
class EndSubscriptionException < Exception; end
class Publisher
def initialize(queue_name, mongo_connection)
# Initialize queue collection as a capped collection
if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name)
@octplane
octplane / watcher.ss
Created May 20, 2020 21:02
kqueue watcher in gerbil scheme
#!/usr/bin/env gxi
(import
:std/format
:std/os/fcntl
:std/os/fdio
:std/os/fd)
(require bsd) (import :std/os/kqueue)
(define observed (make-hash-table-eqv))
@octplane
octplane / README.md
Last active July 25, 2018 22:25
Reese Tag-Sync
  • Reese kafka migration script
  • chef to shell converter for the VPC migration

Keybase proof

I hereby claim:

  • I am octplane on github.
  • I am octplane (https://keybase.io/octplane) on keybase.
  • I have a public key ASB90-lwKP27dmnZdSf26knDO6pom-7QnGIeih6a1K0zrwo

To claim this, I am signing this object:

@octplane
octplane / pixabay_client.rb
Created January 7, 2016 09:16 — forked from joost/pixabay_client.rb
Supersimple http://pixabay.com/api/docs/ Ruby API client.
require 'hashie'
require 'faraday'
require 'faraday_middleware'
# Supersimple http://pixabay.com/api/docs/ client.
# Usage:
# result = PixabayClient.new(key: 'your_key').get(search_term: 'beach')
# result.body # Mashified results
# See: https://gist.github.com/joost/e32daf904ed8bd171974
class PixabayClient
diff --git a/src/vendor/angular/angular.js b/src/vendor/angular/angular.js
index d2115fe..e878eae 100644
--- a/src/vendor/angular/angular.js
+++ b/src/vendor/angular/angular.js
@@ -8779,6 +8779,9 @@ function $RootScopeProvider(){
logIdx, logMsg;
beginPhase('$digest');
+ var ccount = 0;
+ console.time("$digest");
@octplane
octplane / polycorn.md
Last active December 25, 2015 21:08
Life and Death of Unicorns The introduction of our Unicorn management tool, Polycorn. This gists contains the original article about Polycorn plus the source code of Polycorn.

Life and death of Unicorns

The introduction of our Unicorn management tool, Polycorn.

jump into our train!

Photo by Protohiro from Flickr

At Fotopedia, we use Unicorn to serve our main Rails application. Every day, we restart our application several times, spawning and killing hundred of Unicorns. Managing graceful restarts is a complex task, and requires careful monitoring and command. This article introduces our tool Polycorn, a Unicorn management program.

[[MORE]]

@octplane
octplane / gist:6780404
Created October 1, 2013 15:37
Hack of the day. Modify a chef node and remove some attributes by using this script as EDITOR
#!/bin/sh
echo $1.x
jshon -e normal -e log_locations -n array -i picor -p -p < $1 > $1.x
mv $1.x $1
@octplane
octplane / theme.css
Last active December 22, 2015 05:29
ink theming
body {
background-color: #333;
}
#servicePane {
background-color: #242424;
}
#picker {
background-color: #333;
require 'rubygems'
require 'murder'
set :remote_murder_path, '/etc/bundler.chef/vendor/bundle/ruby/1.9.1/gems/murder-0.1.2/dist/' # or some other directory
s = []
pee = s[0..(ENV['COUNT'].to_i || -1)]