Skip to content

Instantly share code, notes, and snippets.

View sohara's full-sized avatar

Sean O'Hara sohara

View GitHub Profile
fr-CA:
errors:
messages:
not_found: "n'a pas été trouvé(e)"
already_confirmed: "a déjà été confirmé(e)"
not_locked: "n'était pas verrouillé(e)"
not_saved:
one: "1 erreur à empêcher ce %{resource} d'être enregistrer :"
other: "%{count} erreurs ont empêcher ce %{resource} d'être enregistrer :"
# Monkey patching required for compatibility between MongoMapper (v. 0.8.6) and
# the master branch of Devise heading towards 1.2. It seems some methods have been moved
# around to different modules/classes within Devise since the 1.1 branch
module Devise
module Orm
module MongoMapper
module Hook
def devise_modules_hook!
extend Schema
@sohara
sohara / table cell locator.rb
Created February 2, 2011 18:48
step definition to test the contents of specific table row given a column heading and the contents of one of the cells in the row
# Locates a table cell based on given row and column content.
When /^(.*) in the "([^\"]*)" column of the "([^\"]*)" row$/ do |action, column_title, row_title|
col_number = 0
all(:xpath, "//*[(th|td)/descendant-or-self::*[contains(text(), '#{column_title}')]]/th").each do |element|
col_number += 1
break if element.has_content?(column_title)
end
within :xpath, "//*[(th|td)/descendant-or-self::*[contains(text(), '#{row_title}')]]/td[#{col_number}]" do
When action
end
@sohara
sohara / blog post temp
Created December 20, 2011 20:56
Blog post
# Improving user experience with Backbone.js
Here's a paragraph
@sohara
sohara / gist:1503563
Created December 20, 2011 22:23
Backbone router example
class Quizback.Routers.TestSessions extends Backbone.Router
routes:
"": "index"
"questions/:id": "showQuestion"
index: () ->
@test_session = new Quizback.Models.TestSession()
@test_view = new Quizback.Views.TestSessionView({model: @test_session})
showQuestion: (questionId) ->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

#Setting up littlebits community dev environment using vagrant

  1. Download the virtual box and install (OS X).
  2. Download and vagrant and install.
  3. Download the littlebits community box from my dropbox.
  4. If you haven't yet cloned the repo, do so now. Otherwise cd into the repo and run 'git pull' to make sure master is in sync with origin.
  5. Once the download of the littlebits box is complete, add it to your local collection of boxes with vagrant box add littlebits /path/to/downloads/littlebits.box
  6. Make sure you are in the cloned project dir for the littlebits community patform. Then run vagrant init littlebits.
  7. After that is complete you are ready to start vagrant: vagrant up. The vm is now running.
  8. Now you can ssh into the vm. Just run vagrant ssh.
module Spree
module Admin
OrdersController.class_eval do
def other
end
def edit
raise StandarError
end
NoMethodError - undefined method `count_on_hand' for nil:NilClass:
/Users/sohara/Sites/little_bits_store/vendor/bundle/bundler/gems/spree-deed1b65f995/core/app/models/spree/stock_location.rb:45:in `fill_status'
/Users/sohara/Sites/little_bits_store/vendor/bundle/bundler/gems/spree-deed1b65f995/core/app/models/spree/stock/packer.rb:19:in `block in default_package'
/Users/sohara/Sites/little_bits_store/vendor/bundle/bundler/gems/rails-8799cfa72d07/activerecord/lib/active_record/associations/collection_proxy.rb:89:in `method_missing'
/Users/sohara/Sites/little_bits_store/vendor/bundle/bundler/gems/spree-deed1b65f995/core/app/models/spree/stock/packer.rb:18:in `default_package'
/Users/sohara/Sites/little_bits_store/vendor/bundle/bundler/gems/spree-deed1b65f995/core/app/models/spree/stock/packer.rb:13:in `packages'
/Users/sohara/Sites/little_bits_store/vendor/bundle/bundler/gems/spree-deed1b65f995/core/app/models/spree/stock/coordinator.rb:21:in `block in build_packages'
/Users/sohara/Sites/little_bi
{
"projects": [
{
"description": "Windmills have been around for over 1000 years, converting wind into power. We created this mini 'mill&nbsp;to keep you cool and charged throughout the day.&nbsp;Make your own lil' Breezy to decorate your desk and help you chill&nbsp;throughout the warm summer.&nbsp;<br><br>",
"id": 357,
"name": "lil' Breezy ",
"primary_image": {
"asset": {
"large": {
"url": "https://littlebits-production.s3.amazonaws.com/uploads/image/asset/1407/large_h5GehzUa4ZqRLGn1yC6xpfCpst61gA7LdIXOA4YcsD8.jpeg"