Skip to content

Instantly share code, notes, and snippets.

View iansheridan's full-sized avatar

Ian Sheridan iansheridan

View GitHub Profile
@iansheridan
iansheridan / api.feature
Created July 20, 2011 11:59 — forked from adamstrickland/api.feature
Cucumber Example for testing a RESTful API
Scenario: Get List of My Hitchhiking Items via API
Given the existing things:
|name|
|The Guide (duh)|
|A towel|
|Sub-Etha Sens-O-Matic|
|Pan Galactic Gargle Blaster|
|Kill-o-Zap blaster pistol|
And the existing accounts:
|email|name|password|
@iansheridan
iansheridan / .tmux.config
Created September 29, 2011 22:26
a sample config file for Tmux
# Last modified: 2011 Sep 14
# Author: Florian CROUZAT <contact@floriancrouzat.net>
# Feel free to do whatever you want with this file.
# Just make sure to credit what deserve credits.
# Binds {{{
# Prefix
unbind C-b
set-option -g prefix C-a
bind a send-prefix
@iansheridan
iansheridan / example.js
Created December 9, 2011 19:45
sample of selecting 5 random items from an array in javascript without any duplications
a = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","aa","bb","cc","dd"];
b = [];
while(b.length<5){
t = Math.round(Math.random() * (a.length-1));
console.log(t,$.inArray(a[t],b));
if($.inArray(a[t],b) == -1){
b.push(a[t]);
}
}
console.log(b[0]);
@iansheridan
iansheridan / watch.rb
Created December 16, 2011 16:30
Watcher script for Ruby
#!/usr/bin/ruby -w
# Ruby implementation of the GNU watch command line utility for Mac OS X.
# Written by: Ian Sheridan. December 2011.
# Email: ian.sheridan[@]gmail.com
if ARGV.length == 0
puts 'Syntax: watch.rb <unix commands>'
puts 'If command contains parameters, make sure to enclose them with single quotes'
exit
@iansheridan
iansheridan / ProxyRb.rb
Created October 12, 2012 18:53 — forked from tstachl/ProxyRb.rb
Sinatra Ruby Javascript Ajax Request Proxy
# Copyright (c) 2012, Thomas Stachl <thomas@stachl.me>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')

chruby can be used with [pow] to select a specific Ruby per project, or system-wide.

System wide

To set a default Ruby for all pow apps, puts the following in ~/.powconfig.

~/.powconfig

@iansheridan
iansheridan / Guide.md
Last active December 18, 2015 15:09
Guide to work with Dags FTB Minecraft server

Dags Minecraft Server Guide

Install Mod

You need to get this file downloaded

TConstruct_mc1.4.7_1.1.5.zip

Once downloaded you install it. Here is a video guide to installing it:

@iansheridan
iansheridan / _overview.md
Last active December 19, 2015 00:59
sample Nginx config for proxying
@iansheridan
iansheridan / save_fingers.sh
Created September 12, 2013 22:30
pre-populate known_hosts file for known ssh access points such as github.com
# HOST == access URI (eg. github.com)
ssh-keyscan -t rsa,dsa HOST 2>&1 | sort -u - ~/.ssh/known_hosts > ~/.ssh/tmp_hosts
cat ~/.ssh/tmp_hosts >> ~/.ssh/known_hosts