Prototype’s selector returns DOM elements.
$("element_id");
// return: <div id="element_id"></div>| # https://vimeo.com/192116528 | |
| require "graphics" | |
| class Clock < Graphics::Simulation | |
| def initialize | |
| @radius = 400 | |
| @margin = 20 | |
| @increment_rate = 0.0009 | |
| @num_lines = 1600 | |
| @line_width = 2 | 
| /** | |
| * Using Operator Mono in Atom | |
| * | |
| * 1. Open up Atom Preferences. | |
| * 2. Click the “Open Config Folder” button. | |
| * 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up. | |
| * 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden! | |
| * 5. Tweak away. | |
| * | |
| * Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png): | 
This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.
First let's check something.
brew info postgresqlThe top of what gets printed as a result is the most important:
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { | 
| /** | |
| * | |
| * Dinesh | |
| * | |
| * RootedTreeTraversal | |
| * - Preorder Traversal | |
| * - Postorder Traversal | |
| * - Inorder Traversal | |
| * - Levelorder Traversal | |
| * | 
| require 'rblineprof' | |
| module Rblineprof | |
| module ConsoleHelpers | |
| include Rblineprof::Helpers | |
| def lineprof_block(options = {}, &block) | |
| profile = lineprof(rblineprof_profiler_regex(options[:lineprofiler])) do | |
| ret = yield | |
| end | 
| 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) | 
| json.array! @ranking.results_with_change.each_with_index.to_a do |args| | |
| # We can't unpack the args in the block param because Jbuilder does | |
| # something magic. | |
| (user, player, diff), index = *args | |
| json.rank index+1 | |
| json.user user, :id, :facebook_id, :name, :square_avatar | |
| json.score player.r.to_i | |
| json.change_today diff.to_i | 
| # add something like this to config.ru | |
| # see https://github.com/kzk/unicorn-worker-killer | |
| if Integer(ENV['UNICORN_KILLER'] || 0) != 0 | |
| require 'unicorn/worker_killer' | |
| # Max memory size (RSS) per worker | |
| use Unicorn::WorkerKiller::Oom, (350*(1024**2)), (400*(1024**2)), 30, true | |
| end |