Skip to content

Instantly share code, notes, and snippets.

View mustmodify's full-sized avatar

Johnathon "jw" Wright mustmodify

View GitHub Profile
@mustmodify
mustmodify / chef_solo_bootstrap.sh
Created June 28, 2012 21:34 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo with MRI 1.8.7
#!/usr/bin/env bash
# based on http://railscasts.com/episodes/339-chef-solo-basics?autoplay=true
# Some of my clients' projects are still on 1.8
# expects to be run on Ubuntu 12+
export RUBY_MAJOR_VER='1.8'
export RUBY_FULL_VER='ruby-1.8.7-p358'
export RUBY_GEMS_VERSION='1.6.2'
@mustmodify
mustmodify / chef_solo_bootstrap.sh
Created July 3, 2012 18:48 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo with MRI 1.9.3
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libmysqlclient-dev libyaml-dev
export RUBY_MAJOR_VER='1.9'
export RUBY_FULL_VER='ruby-1.9.3-p194'
export RUBY_GEMS_VERSION='1.7.2'
cd /tmp
wget http://rubyforge.org/frs/download.php/74619/rubygems-1.7.2.tgz
@mustmodify
mustmodify / app.js
Last active December 17, 2015 02:09
This gist is my attempt to get MapQuest to work with AngularJS templates.
// NOTE: ng-app="plunker" + AngularUI module dependency
var app = angular.module('map-app', []);
app.controller('MapCtrl', function($scope) {
$scope.address = function()
{
out = "";
if( $scope.location.street1 != undefined )
{
@mustmodify
mustmodify / step_two_changes.patch
Last active December 17, 2015 02:19
Apparently you can't link to diffs but you can copy/paste them into a gist and it'll show highlighting. Well thought out.
commit 3d96c72a3ee09f8378fbc91f31832449f1137fcd
Author: Johnathon E. Wright <[email protected]>
Date: Tue May 7 11:01:53 2013 -0700
diff --git a/app.js b/app.js
index dd9b970..0de46e8 100644
--- a/app.js
+++ b/app.js
@@ -4,3 +4,9 @@ var app = angular.module('map-app', []);
app.controller('MainCtrl', function($scope) {
@mustmodify
mustmodify / 69139005c418.diff
Created May 7, 2013 19:11
diff 6913900c418
commit 6913900c41860734a1cb1b7d241393213b28c59b
Author: Johnathon E. Wright <[email protected]>
Date: Tue May 7 12:09:27 2013 -0700
diff --git a/app.js b/app.js
index 0de46e8..5d0eb14 100644
--- a/app.js
+++ b/app.js
@@ -3,6 +3,24 @@ var app = angular.module('map-app', []);
commit 2a5a0d30f104fd1e6326f3ed6ca6484e9819939c
Author: Johnathon E. Wright <[email protected]>
Date: Tue May 7 12:54:11 2013 -0700
diff --git a/app.js b/app.js
index 5d0eb14..a0568df 100644
--- a/app.js
+++ b/app.js
@@ -18,8 +18,11 @@ app.controller('MainCtrl', function($scope) {
window.map = new MQA.TileMap(options);
require 'rubygems'
require 'nokogiri'
doc = Nokogiri::XML('<cats><cat>1</cat><cat>2</cat></cats>')
doc.children
def index
respond_to do |format|
format.xml { render( text: {status: 'success'}.to_xml)}
end
end
@mustmodify
mustmodify / mapper.rb
Last active December 18, 2015 12:39
how to access MapQuest routing directions API via Ruby with HTTParty ...
class MapQuest
include HTTParty
base_uri "www.mapquestapi.com"
format :json
def self.key=(value)
@key = value
end
def self.key
@mustmodify
mustmodify / _on_time_report.html.haml
Created July 4, 2013 12:02
Am I correct in thinking this would NOT be thread safe? As soon as I started to do it I decided it was foolish, but now I'm just curious.
-if on_time_report.any_late?
The following routes are late:
-render :collection => on_time_report.late_routes, ...