Skip to content

Instantly share code, notes, and snippets.

View stuarthannig's full-sized avatar

Stuart Hannig stuarthannig

View GitHub Profile
@stuarthannig
stuarthannig / permission_denied_irb_history-fix.MD
Created June 7, 2017 19:53
How-to: Fix "Errno::EACCES: Permission denied - /.irb-history" when `brew install opentsdb` on Mac OS X Raw

PROBLEM:

Was trying to brew install opentsdb from CLI, but got:

Errno::EACCES: Permission denied - /Users/stuarthannig/.irb-history
  initialize at org/jruby/RubyFile.java:478
        open at org/jruby/RubyIO.java:1135
      (root) at /Users/stuarthannig/.rvm/scripts/irbrc.rb:32
 call at org/jruby/RubyProc.java:270
@stuarthannig
stuarthannig / routes.php
Created August 18, 2015 16:53
Using Guzzle 6 in Laravel 5.1
<?php
# Install Guzzle by running `composer require guzzlehttp/guzzle`
Route::get('github/{username}', function ($username) {
$client = new GuzzleHttp\Client();
$request = $client->get("https://api.github.com/users/{$username}");
echo $request->getBody();
});
@stuarthannig
stuarthannig / appointment.js
Created February 9, 2015 02:17
Backbone Model Defaults
var Appointment = Backbone.Model.extend({
defaults: {
title: 'Checkup'
}
});
# Or cause the defaults to get evaluated every time a new instance is created
var Appointment = Backbone.Model.extend({
defaults: function() {
return {

Scotch Digital Logo

Top Shelf Web Design & Development ♥ We are creative thinkers with a focus on modern web production. We use the latest tools available to help build your brand's digital presence.

A Pen by Nicholas Cerminara on CodePen.

License.

@stuarthannig
stuarthannig / gist:8346939
Created January 10, 2014 04:19
Nitrous.io & GitHub
$ rvm get stable
$ rvm requirements
$ rvm use 2.0.0@<gemset_name> --create --default
ruby-2.0.0-p353 is not installed.
To install do: 'rvm install ruby-2.0.0-p353'
$ gem install rails
$ rails new <project_name> --skip-test-unit
@stuarthannig
stuarthannig / Submitted Link Canonical URL Checker
Last active December 21, 2015 04:09
Check for canonical URLs from a submitted link.
@stuarthannig
stuarthannig / Heroku Postgres test:prepare Workaround
Last active December 20, 2015 23:39
When running 'rake test:prepare' from SSH terminal on the test environment that has a Heroku PostgreSQL database, you will be presented with a Permission Denied error. The following is a simple workaround for that issue.
rake db:migrate VERSION=0 RAILS_ENV=test; rake db:migrate RAILS_ENV=test;
# If you do not have RVM v1.11 installed, you may have to use 'bundle exec' infront of your rake commands, like so:
# bundle exec rake db:migrate VERSION=0 RAILS_ENV=test; bundle exec rake db:migrate RAILS_ENV=test;