Skip to content

Instantly share code, notes, and snippets.

View nocash's full-sized avatar

Beau Dacious nocash

View GitHub Profile
@nocash
nocash / git.io.sh
Last active December 19, 2015 05:19
#!/bin/bash
curl --silent --include --url http://git.io --form "url=$1" \
| awk '/^Location:/ {print $2}'
def rspec(path='')
command = "rspec #{path}"
if File.exist? 'tmp/zeus.pid'
command = "zeus #{command}"
else
command = "bundle exec #{command}"
end
puts command
system command
#!/bin/bash
DIR=$( git rev-parse --show-toplevel )
function zeus_pid {
cat $DIR/tmp/zeus.pid 2>&-
}
function stop_zeus {
pid=$(zeus_pid)
<?php
/*
Plugin Name: Force SSL URL Scheme
Plugin URI: https://gist.github.com/webaware/4688802
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work
Version: 1.0.0-fork (0333d0901593e5b272df5a4e29fa7f576058031a)
Author: WebAware
Author URI: http://www.webaware.com.au/
Modified By: Beau Beveridge
Modifications:
@nocash
nocash / te-clock.rb
Last active August 29, 2015 14:05
TextExpander snippet to create semi-accurate :clock: emoji. http://www.emoji-cheat-sheet.com/#e_807
#!/usr/bin/env ruby
time = Time.now
hour = time.strftime('%-l').to_i
hour += 1 if time.min > 44
mins = (15..44).include?(time.min) ? '30' : ''
print ":clock#{hour}#{mins}:"
@nocash
nocash / te-random_email.rb
Last active August 29, 2015 14:05
TextExpander script to append random +string to Gmail address.
#!/usr/bin/env ruby
require 'securerandom'
hex = SecureRandom.hex(4)
email = "%snippet:@@email%"
print email.sub("@", "+#{hex}@")
@nocash
nocash / gw2-events.yml
Last active August 29, 2015 14:06
List of Guild Wars 2 event times.
# https://d3b4yo2b5lbfy.cloudfront.net/wp-content/uploads/2014/06/0e65eWorld-Event-Times-EN-6-17-2014.pdf
---
- name: Tequatl
tier: 3
duration: 1800
schedule:
- '00:00:00 UTC'
- '03:00:00 UTC'
- '07:00:00 UTC'
- '11:30:00 UTC'
# Automatically includes files under spec/support.
Dir["./spec/support/**/*.rb"].sort.each { |f| require f }
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
# This option will default to `true` in RSpec 4. It makes the `description`
# and `failure_message` of custom matchers include text for helper methods
# defined using `chain`, e.g.:
# be_bigger_than(2).and_smaller_than(4).description
#!/bin/bash -e
ack_args=$@
git_ref='master'
pattern='TODO|NOTE|XXX'
function committed_files {
git diff ${git_ref}..HEAD --diff-filter=ACMX -G"$pattern" --name-only
}
<?php
function _debug() {
$args = func_get_args();
echo '<pre>';
foreach($args as $arg) { var_dump($arg); }
echo '</pre>';
}