Skip to content

Instantly share code, notes, and snippets.

View jipiboily's full-sized avatar

JP Boily jipiboily

  • Alma, Quebec, Canada
View GitHub Profile
@jipiboily
jipiboily / gist:1078638
Created July 12, 2011 18:37
Tableview.appendRow crashes with Titanium Mobile 1.7.X
[INFO] One moment, building ...
[DEBUG] Detecting modules in /Users/macbook_pro_jpb/ti_studio_workspace/1.7.1 tableview crashing test/modules
[DEBUG] Detecting modules in /Library/Application Support/Titanium/modules
[INFO] Titanium SDK version: 1.7.1
[INFO] iPhone Device family: iphone
[INFO] iPhone SDK version: 4.3
[INFO] iPhone simulated device: iphone
[DEBUG] executing command: /usr/bin/killall iPhone Simulator
[DEBUG] No matching processes belonging to you were found
[DEBUG] finding old log files
@jipiboily
jipiboily / gist:1879132
Created February 21, 2012 21:37
Refinery and Spree: rails generate refinery:cms --fresh-installation # on a Spree project using master
/my/rvm/gemset/gems/activerecord-3.2.1/lib/active_record/dynamic_matchers.rb:50:in `method_missing': undefined method `has_attached_file' for #<Class:0x007fb9743d8288> (NoMethodError)
from /my/rvm/gemset/bundler/gems/spree-f9370e2b745f/core/app/models/spree/image.rb:4:in `<class:Image>'
from /my/rvm/gemset/bundler/gems/spree-f9370e2b745f/core/app/models/spree/image.rb:2:in `<module:Spree>'
from /my/rvm/gemset/bundler/gems/spree-f9370e2b745f/core/app/models/spree/image.rb:1:in `<top (required)>'
from /my/rvm/gemset/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:469:in `load'
from /my/rvm/gemset/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:469:in `block in load_file'
from /my/rvm/gemset/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /my/rvm/gemset/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:468:in `load_file'
from /my/rvm/gemset/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:353:in `require_or_load'
fro
@jipiboily
jipiboily / gist:1955326
Created March 2, 2012 03:24
How to apply an override with Deface
# Step 1: you need to add the files in say "app/overrides", ie: "/app/overrides/insert_this_here.rb"
# Step 2: add that in your application.rb to load them (and decorators)
config.to_prepare do
# Load application's model / class decorators (optional for Deface, but you should have it in your app if you use Spree AFAIK.
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
end
# Load application's view overrides
Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c|
@jipiboily
jipiboily / _actions.html.erb
Created April 8, 2012 18:12
How to setup a Refinery custom content type and view (aka "page template")
<!-- path: app/views/refinery/admin/pages/_actions.html.erb -->
<!--
You could override this view, if you want to add links to each page type via the admin UI. If you don't you'll have to add a param the the URL.
WARNING: You most probably want to do it cleaner than that and find a way to hook to this view instead of overriding it if at all possible.
-->
<ul>
<li>
<%= render '/refinery/admin/search', :url => refinery.admin_pages_path %>
</li>
@jipiboily
jipiboily / app.js
Created October 27, 2012 20:48
Fixed view example for Ember's Getting Started guide
// [...]
Todos.ListTodosView = Ember.View.extend({
templateName: 'todo-list',
todosBinding: 'Todos.todosController'
});
@jipiboily
jipiboily / output_sample.txt
Last active December 10, 2015 23:38
RSpec: top failing specs report
------------------------------------------------
Top failing specs
------------------------------------------------
18 | ./spec/models/my_model_spec.rb
4 | ./spec/models/your_failing_model_spec.rb
@jipiboily
jipiboily / gist:4960321
Last active December 13, 2015 19:08
Worst answer in a ticket that I opened to say I was not able to answer another ticket...
Your reported issue has been fixed. I have noticed that the subject line of the ticket
#X "Invoice for your Y account"...but why? was causing the issue while updating the ticket.
Currently, I have changed the subject line of the ticket #X from "Invoice for your Y account"...but why?
to 'Invoice for your account'. Now you should be able to update/close the mentioned ticket without any issue.
I suggest you not to use ant special charterers like -, “, and ? in the subject line of the ticket.
@jipiboily
jipiboily / migration.rb
Created May 9, 2013 11:41
Migration for a model that does not exist in the app
class MyMigrationForSomething < ActiveRecord::Migration
class Monologue::PostsRevision < ActiveRecord::Base
end
def up
Monologue::PostsRevision.reset_column_information # This might not be necessary, but you know it exists if needed! :)
# do your stuff here...
end
def down
@jipiboily
jipiboily / dokku_pg_etc.sh
Last active December 20, 2015 20:28
Bootstrap script for Dokku + postgres 9.1. Also creates a .pgpass and creates a database
# Tested on Ubuntu 13.04 x64
# You need to set those environment variables
#```
# export DATABASE_USER=username_here
# export DATABASE_PASSWORD=password_here
# export DATABASE_NAME=database_name_here
# export DATABASE_ROOT_PASSWORD=database_root_password
# ```
# ON SERVER
@jipiboily
jipiboily / not_rescued.rb
Created April 4, 2014 14:58
Can we do this?
trace = TracePoint.new(:raise) do |trace|
puts trace.raised_exception if "IT WAS NOT RESCUED"
end
trace.enable