I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
require "active_record" | |
namespace :db do | |
db_config = YAML::load(File.open('config/database.yml')) | |
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
desc "Create the database" | |
task :create do | |
ActiveRecord::Base.establish_connection(db_config_admin) |
Example app found at http://goo.gl/K0Lf61
This app requires EmberCLI to be installed. You can install it via npm using npm install -g ember-cli
$ ember new guru-app
$ cd guru-app
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
#If you don't have colorize gem, do install it via 'gem install colorize' | |
#Update | |
#Add cache categories function | |
require 'csv' | |
require 'readline' | |
require 'colorize' | |
require 'json' | |
CACHED_CATEGORIES_FILE = "cache_categories.json" | |
cache_categories = JSON.parse(File.open(CACHED_CATEGORIES_FILE).read) rescue {} |