Skip to content

Instantly share code, notes, and snippets.

View boffbowsh's full-sized avatar

Paul Bowsher boffbowsh

View GitHub Profile
#!/usr/bin/env node
var amqp = require("amqp");
// Config
var fromHost = { host: 'message1', login: 'guest', password: 'guest' };
var toHost = { host: 'message3', login: 'guest', password: 'guest' };
var queueName = "queuename";
var queueOpts = {durable: true, passive: true, noDeclare: true};
#!/bin/bash
test -f ~/.pomodoro || exit
FIGLET="/usr/local/bin/figlet -Wf banner3"
diff=$(($(stat -f%m ~/.pomodoro) + (25*60) - $(date +"%s")))
if [[ $diff -lt 0 && $diff -gt -15 ]]; then
echo "0:00" | $FIGLET
elif [[ $diff -gt 0 ]]; then
Vagrant.configure("2") do |config|
config.vm.define "centos1" do |config|
config.vm.box = "centos-5.6"
config.vm.box_url = "http://dl.dropbox.com/u/9227672/centos-5.6-x86_64-netinstall-4.1.6.box"
config.vm.provision "shell", path: "centos.sh"
config.vm.network :private_network, ip: "192.168.56.201"
config.vm.hostname = "rabbit1"
end
config.vm.define "centos2" do |config|
#!/usr/bin/perl
use strict;
use LWP::Simple;
use JSON;
use IO::Socket;
use Env qw(RABBITMQ_LOCAL RABBITMQ_OTHER RABBITMQ_USER RABBITMQ_PASS RABBITMQ_NODE_NAME);
sub print_headers {
my $st = shift;
#!/bin/bash
# apt-get install jq
#set -eu
shopt -s nullglob
readonly base_dir=$1
if [ -z "$base_dir" ] ; then
echo 'please location docker registry store location!';
exit;
fi
@boffbowsh
boffbowsh / edit.hbs
Created December 30, 2014 00:48
Set a form to use the shadowModel of the controller, and changes won't be saved back to the model (and your list-of-models next to the form) until you call `save()`. Will probably break with relationships, that'll need fixing.
{{#em-form model=shadowModel}}
{{em-input property="name" label="Name"}}
{{em-input property="slug" label="Slug"}}
{{/em-form}}
KEY_COLUMN = 2
with csv.reader(f1) as csv1:
d1 = {r[KEY_COLUMN]: r for r in csv1}
with csv.reader(f2) as csv2:
d2 = {r[KEY_COLUMN]: r for r in csv2}
merged_dict = {x:d1[x] for x in d1 if x in d2}
121 Recruitment
Abbeywood International Recruitment T/A ABW recruitment
ABRS Limited
AdRoc Limited
Advanced Resource Managers IT Limited
@boffbowsh
boffbowsh / gist:28da0cdd02022b26eada
Created May 17, 2015 10:17
Diff of output of Sass and SassC for Whitehall
< html input[type="button"],
< input[type="reset"],
> html input[type="button"], input[type="reset"],
< .row:before, .row:after {
> .row:before,
> .row:after {
< .row-fluid:before, .row-fluid:after {
> .row-fluid:before,
> .row-fluid:after {
< *margin-left: 85.0%;
source "https://rubygems.org"