- Who owns the Future - Jaron Lanier
- Capital in the Twenty-First Century - Thomas Piketty
- How we got to now, 6 inventions - S. Johnson
- Danubia - Simon Winder
- Stragic Storytelling - Dane McKinsey
- The Dazzle of the Day - Molly Glass
- The Shepards Life - James Rebanks
- Incognito - David Eagleman
- [A General Theory of Love](http://www.amazon.com/General-Theory-Love-Thomas-Lewis/dp/0375709223
I've written this code to test what happens once a Stripe card token has been passed through to the server. This code does not do any browser testing (because JS-friendly headless testing is painful at best, and impossible if you want VCR in the mix). VCR is being used here to capture interactions with a test Stripe account, to ensure the tests are fast on future runs. That said, it's structured so that nothing is expected to be present in the Stripe account. If you delete all the stored VCR cassettes, the specs will safely re-record them.
Instead of using VCR.use_cassette
directly, instead you use stripe_cassette
in your specs, passing in the current spec example object. This will automatically generate a cassette name based on the spec's file name and the example's description (limitations of this are noted in the code comments). Within the cassette's recording block, Stripe data is cleared out before yielding back to the spec, with a context object. The context object provides access to helper methods
-
Constraints - super important for ensuring data integrity (bad data can't get into the DB)
- UNIQUE indexes to ensure a record is unique on one or more column values
- CHECK constraints allow some basic logic you can use (https://www.postgresql.org/docs/current/static/ddl-constraints.html)
- FOREIGN KEY (FK)'s - very important for ensuring referential integrity. Lets the database knows about relations between tables, and what to do if a record is deleted or updated (how related tables should change) - e.g. should related records be deleted (ON DELETE CASCADE)
- Anything more complicated than the above, you'll need to write a TRIGGER (https://www.postgresql.org/docs/current/static/sql-createtrigger.html)
- Learning/using PL/pgSQL will be very important here (https://www.postgresql.org/docs/9.6/static/plpgsql.html). Although you can write triggers in other languages w/ extensions, such as Python or JavaScript, but usually you only do that if you need a specific library or something.
-
Indexes - i
var monkeyPatches = { | |
'_livedata_data': 'DATA', | |
'_livedata_error': 'ERROR', | |
'_livedata_nosub': 'NOSUB', | |
'_livedata_connected': 'CONNECTED', | |
'_livedata_result': 'RESULT', | |
}; | |
_.each(_.keys(monkeyPatches),function(funcName){ | |
var modifiedFunctionName = funcName+'_original'; | |
var extension = {}; |
Here are all of the resources mentioned by Deconstruct 2017 speakers, along with who recommended what. Please post a comment if I missed something or have an error!
- Seeing Like a State by James Scott
- Public Opinion by Walter Lippmann (Evan Czaplicki)
- A Pattern Language by Christopher Alexander (Brian Marick)
- Domain Driven Design by Eric Evans (Brian Marick)
FROM ruby:3.0-alpine | |
RUN apk add --no-cache --update \ | |
ack \ | |
bash \ | |
build-base \ | |
curl \ | |
git \ | |
htop \ | |
less \ |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
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) |
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.