Skip to content

Instantly share code, notes, and snippets.

View oisin's full-sized avatar
💭
Thing.

Oisín Hurley oisin

💭
Thing.
View GitHub Profile
@oisin
oisin / feedback.m
Created February 9, 2014 15:56
Changing the background colour of the Converser SDK generated feedback form.
# Simple tester for Converser SDK feedback form manipulation. No network connections
# made.
#import "CIOSecondViewController.h"
@interface CIOSecondViewController ()
@property (strong,nonatomic) VGConversationEngine *converser;
@end
@implementation CIOSecondViewController
@oisin
oisin / get_indexes
Created November 18, 2013 11:49
Grab all the indexes from a Mongo instance
$ mongo host:port/db
MongoDB shell version: 2.2.3
connecting to: host:port/db
> db.auth('myuserid','mypassword')
1
> db.system.indexes.find()
{ "v" : 1, "key" : { "_id" : 1 }, "ns" : "db.system.users", "name" : "_id_" }
{ "v" : 1, "key" : { "_id" : 1 }, "ns" : "db.administrators", "name" : "_id_" }
{ "v" : 1, "key" : { "_id" : 1 }, "ns" : db.apps", "name" : "_id_" }
{ "v" : 1, "key" : { "app_id" : 1 }, "unique" : true, "ns" : "db.apps", "name" : "app_id_1" }
// Android apps include Converser initialization and subscription
// as part of an activity. In the code snippet below, it shows useful
// places to put the code so that it is initialised and subscribes at
// the right time.
public class YourActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
// When this activity is created, initialize Converser with the correct key and endpoint
// this doesn't actually connect to the server, it just sets it up ready to go for the
@oisin
oisin / pr.md
Created October 15, 2013 08:50 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@oisin
oisin / allbranches.sh
Created September 25, 2013 13:00
Track all the branches on the remote, locally. Useful for when you are moving a repo from one remote to another.
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
@oisin
oisin / AWS S3 Log Regex
Created September 14, 2013 15:59
Ruby regex for targetting AWS S3 logs for the Verbose podcast
/.* verbose-ireland \[(.*)\] (\d+.\d+.\d+.\d+) .* REST.GET.OBJECT \d+_TheVerbosePodcast_-_Episode(\d+).mp3 .* - (\d+) (\d+) (\d+) (\d+) "(.*)" "(.*)".*/
@oisin
oisin / gist:6562181
Created September 14, 2013 13:46
Override Postgres defaults when you have installed the Postgres.app application on OS X, and you need to compile native extensions for a Ruby gem with bundler.
gem install do_postgres -- --with-pgsql-server-dir=/Applications/Postgres.app/Contents/MacOS --with-pgsql-server-include=/Applications/Postgres.app/Contents/MacOS/include/server
@oisin
oisin / Gemfile
Created September 10, 2013 09:12
Simple AMQP clients using Bunny and CloudAMQP
source 'https://rubygems.org'
gem 'bunny'
gem 'json'
@oisin
oisin / gist:6328241
Created August 24, 2013 13:49
Building Erlang from source on OS X 10.9 - don't forget SSL
# Get the 1.0.1 version of SSL
brew install openssl
./configure --disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-darwin-64bit --with-ssl=/usr/local/opt/openssl
touch lib/wx/SKIP lib/odbc/SKIP
make -j4
sudo make install