This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instead of : | |
SearchView = Backbone.View.extend({ | |
initialize: function(){ | |
this.render(); | |
}, | |
render: function(){ | |
// Compile the template using underscore | |
var template = _.template( $("#search_template").html(), {} ); | |
// Load the compiled HTML into the Backbone "el" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instead of | |
SearchView = Backbone.View.extend({ | |
initialize: function(){ | |
this.render(); | |
}, | |
render: function(){ | |
// Compile the template using underscore | |
var template = _.template( $("#search_template").html(), {} ); | |
// Load the compiled HTML into the Backbone "el" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Pandemic | |
class Engine < ::Rails::Engine | |
isolate_namespace Pandemic | |
initializer "pandemic.asset_addition", :group => :all do |app| | |
initializer_path = "#{Rails.root}/config/initializers/pandemic.rb" | |
# Forces rails to pull in the initializer even if initialize_on_precompile | |
# is false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inside config/environments/development.rb | |
# Do the following after every request to the server in development mode | |
ActionDispatch::Callbacks.to_cleanup do | |
# If the gem's top level module is currently loaded, unload it | |
if Object.const_defined?(:MyCoolGem) | |
Object.send(:remove_const, :MyCoolGem) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"web-app": { | |
"servlet": [ | |
{ | |
"servlet-name": "cofaxCDS", | |
"servlet-class": "org.cofax.cds.CDSServlet", | |
"init-param": { | |
"configGlossary:installationAt": "Philadelphia, PA", | |
"configGlossary:adminEmail": "[email protected]", | |
"configGlossary:poweredBy": "Cofax", | |
"configGlossary:poweredByIcon": "/images/cofax.gif", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"completed": 10, | |
"started": 1 | |
}, | |
"status": 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Setup: | |
Assuming Odoo 8.0 sources at ~/odoo: | |
$ cp odoo-sh.py ~/odoo | |
$ cd ~/odoo | |
$ python -i odoo-sh.py | |
Usage example: | |
>>> env = connect('my-db-name') | |
>>> Users = env['res.users'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'selenium-webdriver' | |
gem 'webdrivers' | |
gem 'capybara' | |
gem 'byebug' | |
gem 'puma' | |
end |