Skip to content

Instantly share code, notes, and snippets.

View astjohn's full-sized avatar

Adam St. John astjohn

View GitHub Profile
$ bundle exec cucumber -b features/dashboard.feature
Using the default profile...
........F-
(::) failed steps (::)
bad content body (EOFError)
/usr/local/rvm/gems/ruby-1.9.2-p0@money_bags/gems/rack-1.2.1/lib/rack/utils.rb:547:in `block in parse_multipart'
/usr/local/rvm/gems/ruby-1.9.2-p0@money_bags/gems/rack-1.2.1/lib/rack/utils.rb:499:in `loop'
@astjohn
astjohn / ndef_experiment.cpp
Created November 26, 2011 03:56
Experiments with libndef
// More complicated SP
NDEFRecord text = NDEFRecord::createTextRecord("Could be an ID here...", "en-US");
// USING THIS ACTION RECORD RESULTED IN TRUNCATED truncated OUTPUT
// NDEFRecord action = NDEFRecord::createSpActionRecord(NDEFRecord::Do); // should have value of zero
NDEFRecord type = NDEFRecord::createSpTypeRecord("application/json"); // not necessary
QList<NDEFRecord> records;
records.append(text);
// records.append(action);
@astjohn
astjohn / jruby_bundler_output
Created March 15, 2012 15:59
Lion, Bundler 1.1.1, RVM, JRuby-1.6.7
Updating https://github.com/astjohn/subexec.git
Updating https://github.com/elevation/event_calendar.git
Updating https://github.com/zenapsis/backbone-rails.git
Updating https://github.com/parallel588/mustache_rails3.git
Updating https://github.com/bemurphy/minitest-mongoid.git
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Using rake (0.9.2.2)
Using multi_json (1.1.0)
Using activesupport (3.1.4)
@astjohn
astjohn / spec
Created March 15, 2012 19:29
Let not working in scope of nested describe
require 'helper'
describe ZenGenerator do
let (:good_attributes) do
Hash.new(start: 20, finish: 30, prefix: "V", suffix: "X", prefix_zeroes: true)
end
describe "Initialization:" do
describe "#initialize" do
@astjohn
astjohn / default_scope_uniqueness.rb
Created April 13, 2012 00:34
default_scope is interfering with uniqueness validation in mongoid
class Country
include Mongoid::Document
field :country_code, type: String
field :status, type: String, default: "review"
validates_uniqueness_of :country_code
default_scope where(status: "published")
end
c1 = Country.create!(country_code: "CA", status: "published")
c2 = Country.new(country_code: "CA")
@astjohn
astjohn / authentication.rb
Created November 1, 2012 18:59
Rspec Setup for Controller Testing With Devise
# /spec/support/authentication.rb
# sign in methods to use in a before block
# you will then have access to the corresponding account variable such as '@user'
# or '@admin' throughout your test suite
# sign in a user
def sign_in_user(user=nil)
sign_out_all
@user = user || FactoryGirl.create(:user_w_trip)
@astjohn
astjohn / example.js.coffee
Last active December 16, 2015 18:29
Attempting to get torquebox stomplets working. Using torquebox 2.3.0. Cookie based session storage, though torquebox_store produces same result.
# Example coffeescript
_initialize_stomp: ->
@stomp_client.connect(null, null, (response) =>
console.log "STOMP CONNECT", response
@stomp_client.subscribe("/trips/#{@trip_id}/travel_package", (message) ->
console.log "SUBSCRIBED", message
)
)
$ unzip -vl /Users/astjohn/Development/sitata/mobile/sdk/sdk-xamarin-bindings-ios/demo/SitataQs/obj/iPhoneSimulator/Release/mtouch-cache/SitataCore.framework.zip
Archive: /Users/astjohn/Development/sitata/mobile/sdk/sdk-xamarin-bindings-ios/demo/SitataQs/obj/iPhoneSimulator/Release/mtouch-cache/SitataCore.framework.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
0 Stored 0 0% 09-28-2017 15:33 00000000 Headers/
1178 Defl:N 366 69% 09-28-2017 15:33 87ea032d Headers/SitataCore-umbrella.h
960 Defl:N 413 57% 09-28-2017 15:17 bed6fc41 Headers/STASDKApiAlert.h
546 Defl:N 301 45% 09-28-2017 15:17 4f396f19 Headers/STASDKApiCountry.h
1307 Defl:N 369 72% 09-28-2017 15:17 389dfb71 Headers/STASDKApiHealth.h
459 Defl:N 274 40% 09-28-2017 15:32 f51eec09 Headers/STASDKApiMisc.h
Microsoft (R) Build Engine version 15.3.0.0 (d15.3/17f02c2 Thu Jul 20 17:17:06 EDT 2017) for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/MSBuild.dll /verbosity:diag SitataCore.iOS.csproj
Build started 2017-09-29 2:13:48 PM.
Environment at start of build:
COLORTERM = truecolor
rvm_bin_path = /Users/astjohn/.rvm/bin
LOGNAME = astjohn
CLICOLOR = 1
unzip -vl /Users/astjohn/Development/sitata/mobile/sdk/sdk-xamarin-bindings-ios/SitataCore.iOS/obj/Debug/SitataCore.framework
Archive: /Users/astjohn/Development/sitata/mobile/sdk/sdk-xamarin-bindings-ios/SitataCore.iOS/obj/Debug/SitataCore.framework
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
6148 Defl:N 285 95% 09-28-2017 15:33 f085dfa0 .DS_Store
0 Stored 0 0% 09-28-2017 15:33 00000000 GooglePlaces.bundle/
0 Stored 0 0% 09-28-2017 15:32 00000000 GooglePlaces.bundle/ar.lproj/
703 Defl:N 457 35% 09-28-2017 15:32 99f2f526 GooglePlaces.bundle/ar.lproj/GooglePlaces.strings
0 Stored 0 0% 09-28-2017 15:32 00000000 GooglePlaces.bundle/ca.lproj/
698 Defl:N 466 33% 09-28-2017 15:32 d3252a6c GooglePlaces.bundle/ca.lproj/GooglePlaces.strings