Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
#!/usr/bin/env ruby | |
require "openssl" | |
require 'digest/sha2' | |
require 'base64' | |
# We use the AES 256 bit cipher-block chaining symetric encryption | |
alg = "AES-256-CBC" | |
# We want a 256 bit key symetric key based on some passphrase | |
digest = Digest::SHA256.new |
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 postgresql
The top of what gets printed as a result is the most important:
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html | |
Hi everyone, I'm Chris Wanstrath. | |
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But | |
then I took a few moments and thought, Wait, why? Why me? What am I supposed | |
to say that's interesting? Something about Ruby, perhaps. Maybe the | |
future of it. The future of something, at least. That sounds | |
keynote-y. | |
###Quick links to get started:
http://nithinbekal.com/posts/rails-presenters/
http://eewang.github.io/blog/2013/09/26/presenting-the-rails-presenter-pattern/
This is a collection of links, examples and rants about Presenters/Decorators in Rails.
The course will have six weeks of lectures and assignments, followed by a final exam.
Yahoo! provides its GeoPlanet data as three separate TSV files, available for download here.
That's a database with some 17 million records:
belongs_to
association does not automatically save the object. It does not save the associated object either.has_one
association, that object is automatically saved (in order to update its foreign key).has_one
association) is unsaved (that is, new_record?
returns true) then the child objects are not saved. They will automatically when the parent object is saved.DROP TABLE IF EXISTS survey_sessions; | |
-- Imagine a table with survey sessions | |
-- token: some id or token to access a survey | |
-- answers: a key value store for answers | |
CREATE TABLE survey_sessions ( | |
token text, | |
answers hstore); | |
-- We need some data to play with | |
INSERT INTO survey_sessions (token, answers) VALUES ('9IaxxP', 'a=>1, b=>2'); |