The below article will cover the intricacies of setting up databases and heroku in respect to a flask app. This is more like a memo and will have out of sequence instructions or solutions to errors so read thoroughly.
You'll need the packages
/* global chrome, MediaRecorder, FileReader */ | |
chrome.runtime.onConnect.addListener(port => { | |
let recorder = null | |
port.onMessage.addListener(msg => { | |
console.log(msg); | |
switch (msg.type) { | |
case 'REC_STOP': | |
console.log('Stopping recording') | |
if (!port.recorderPlaying || !recorder) { |
The below article will cover the intricacies of setting up databases and heroku in respect to a flask app. This is more like a memo and will have out of sequence instructions or solutions to errors so read thoroughly.
You'll need the packages
Author: Chris Lattner
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244 | |
// 99.99% Credit to Martin R! | |
// Mapping from XML/HTML character entity reference to character | |
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references | |
private let characterEntities : [String: Character] = [ | |
// XML predefined entities: | |
""" : "\"", | |
"&" : "&", |
// Playground - noun: a place where people can play | |
import UIKit | |
var str = "Hello, playground" | |
enum TimeIntervalUnit { | |
case Seconds, Minutes, Hours, Days, Months, Years | |
func dateComponents(interval: Int) -> NSDateComponents { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
@tenderlove asked "Is it good to teach RSpec (vs t/u) to people who are totally new to Ruby?" I have experience suggesting that it is a good thing; after a short back and forth, it seemed useful to write it up in detail.
This goes back several years, to when I was the primary Ruby/Rails trainer for Relevance from 2006-2009. I'm guessing that worked out to probably 6-8 classes a year during those years. Since then, RSpec has changed a fair amount (with the addition of expect
) and test/unit has changed radically (it has an entirely new implementation, minitest, that avoids some of the inconsistencies that made test/unit a bit confusing during the time I'm writing about here).
I started out as an RSpec skeptic. I've never been afraid of what a lot of people denigrate as "magic" in Ruby libraries … to me, if you take the trouble to understand it, that stuff's just pr
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
# with their associated values. For example, "{ status: 'delayed' }" would call |
This is my hand-rolled solution for getting Angular assets (Controllers, Models, Directives, Templates, etc.) integrated into the Rails Asset Pipeline.
Of particular note: this hack will also load the AngularJS $templateCache
with your templates,
while allowing you to use Slim, ERB, etc. to write your templates.
@akhleung is working on hcatlin/libsass and was wondering how @extend
is
implemented in the Ruby implementation of Sass. Rather than just tell him, I
thought I'd write up a public document about it so anyone who's porting Sass or
is just curious about how it works can see.
Note that this explanation is simplified in numerous ways. It's intended to
explain the most complex parts of a basic correct @extend
transformation, but
it leaves out numerous details that will be important if full Sass compatibility