A simple rake task that replicates the rails console
for Lotus Framework
I assume that your config/application.rb
is the place where you
initialize all Lotus boot config
below is my config/application.rb
for your interest
# This is not as sophisticated as ActiveSupport's `strip_heredoc`, but is the simplest solution for | |
# removing leading whitespace. | |
# For more nuanced whitespace removal, take a look at http://apidock.com/rails/String/strip_heredoc | |
puts "With leading whitespace:" | |
puts <<-TEST | |
This is a test. | |
To remove leading spaces. | |
From Ruby's heredoc operator. | |
TEST |
Notes from Tuning Legacy Rails App: How to Make an Elephant Sprint
###Measuring performance
class Location < Struct.new(:city, | |
:state, | |
:zipcode) | |
def initialize(from_hash) | |
super(*from_hash.values_at(*members)) | |
end | |
def display_city | |
city.capitalize |
// some pieces of this file have been omitted | |
let React = require('react') | |
let notesStore = require('../../stores/notesStore') | |
let monitorMixin = require('../../mixins/monitorMixin') | |
let Notes = React.createClass({ | |
mixins: [monitorMixin(notesStore)] | |
// this gets called whenever `notesStore` emits a change event |
SELECT organizations.name, | |
organizations.id, | |
organizations.ancestry, | |
tmp.average_activated_time_of_children from organizations | |
JOIN ( | |
SELECT org.ancestry, | |
AVG(org.updated_at - org.created_at) as average_activated_time_of_children, | |
CAST(substring(org.ancestry from '\d+(?!\/)$') as integer) as organization_id | |
FROM organizations org | |
INNER JOIN accounts acc ON acc.organization_id=org.id |
/** | |
* Ref $elector Mixin | |
*/ | |
export default { | |
$(ref) { | |
return this.refs[ref].getDOMNode() | |
} | |
} |
(ns roman-numerals.core-test | |
(:require [clojure.test :refer :all])) | |
(def mapping { | |
0 "" | |
1 "I" | |
4 "IV" | |
5 "V" | |
9 "IX" | |
10 "X" |
default_run_options[:pty] = true # Must be set for the password prompt from git to work | |
# WebFaction user account | |
# This is the server user account | |
set :server_user, "<server_username>" | |
# Server Domain | |
set :domain, "<domain_name>" | |
set :user, server_user | |
# Repository User |
class Seeder | |
def create_data | |
100.times do | |
create_user | |
create_event | |
end | |
end | |
private |