Skip to content

Instantly share code, notes, and snippets.

View iansheridan's full-sized avatar

Ian Sheridan iansheridan

View GitHub Profile
// screep astar
// based off of javascript-astar 0.4.1
// http://github.com/bgrins/javascript-astar
// Freely distributable under the MIT License.
// Implements the astar search algorithm in javascript using a Binary Heap.
// Includes Binary Heap (with modifications) from Marijn Haverbeke.
// http://eloquentjavascript.net/appendix2.html
// Modified for Screeps by Robert Hafner
@iansheridan
iansheridan / Roll20 Mystara Calendar
Last active November 16, 2017 23:13 — forked from shdwjk/Roll20 Mystara Calendar
My first release of a Mystara Calendar API Script for Roll20.
var Calendar = Calendar || {
version: '0.0.1',
lunarPhaseSize: 15,
lunarPhasesImage: 'https://s3.amazonaws.com/files.d20.io/images/4277527/CJJWBbiHx3jHglPdccPx3A/max.png?1401939451',
clearImage: 'https://s3.amazonaws.com/files.d20.io/images/4277467/iQYjFOsYC5JsuOPUCI9RGA/max.png?1401938659',
_Ordinal: function(num) {
var ones=(num%10);
var tens=((num%100)-ones);
switch(ones)
@iansheridan
iansheridan / tmux.conf
Last active August 29, 2015 14:26 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = OrgAuthor: Ankit Goyal
# = Author: Ian Sheridan
#################################################################
@iansheridan
iansheridan / status.conf
Last active August 29, 2015 14:14 — forked from dhrrgn/status.conf
server {
listen 80;
server_name localhost;
location /status {
access_log off;
default_type text/plain;
return 200 "alive";
}
}

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

=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')
@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.
@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|
# Optional more complicated strat for the database.yml
require 'ftools'
namespace :config do
task :build do
File.mkdir_p temp_config_dir
# this is the place to hook after when creating a config file
end
task :update do
# upload contents of temp_config_dir to #{release_path}/config