Skip to content

Instantly share code, notes, and snippets.

Swizec / gist:1c45d563c143c666c4a3
Created Nov 30, 2015
React Indie Bundle free sample
View gist:1c45d563c143c666c4a3
Hey,<br />
<br />
Thanks for checking out the React Indie Bundle.<br />
Here are the 4 book chapters and 42min of videos we promised:
<li><a href=";list=PLF8WgaD4xmjUfL4lo12ugd9ZIheP-sGrB&amp;index=1&amp;utm_source=drip&amp;utm_medium=email&amp;utm_campaign=react-bundle-sample">Build Web Apps with React JS and Flux</a>&nbsp;(3 videos)</li>
<li><a href=";utm_medium=email&amp;utm_campaign=react-bundle-sample">React.js by example</a> (book chapter)</li>
<li><a href=";utm_medium=drip&amp;utm_campaign=react-bundle-sample">React+d3.js</a> (book chapter)</li>
<li><a href=";list=PLF8WgaD4xmjUfL4lo12ugd9ZIheP-sGrB&amp;index=5&amp;utm_source=email&amp;utm_medium=drip&amp;utm_campaign=react-bundle-sample">Build Apps with React Native</a> (4&nbsp;videos)</li>
<li><a href="https://dl.dropb
Swizec / assets.rake
Last active Oct 3, 2015
Webpack rails configs
View assets.rake
# lib/tasks/assets.rake
# The webpack task must run before assets:environment task.
# Otherwise Sprockets cannot find the files that webpack produces.
namespace :assets do
# In this task, set prerequisites for the assets:precompile task
task compile_environment: :webpack do
View gist:b7bf942779e2121b97c9
def upgrade():
op.add_column('control_assessments', sa.Column('control_id', sa.Integer()))
op.create_foreign_key('fk_control_control_assessment', 'control_assessments', 'controls', ['control_id'], ['id'])
def downgrade():
op.drop_column('control_assessments', 'control_id')
op.drop_constraint('fk_control_control_assessment', 'control_assessments', 'controls')
View gist:55a53a7a2dd966c78152
var module = angular.module("device-picker", ['ng']);
module.controller("bla", ['$scope', function ($scope) {
View gist:6593317
function filter (predicate, list) {
return (a) {
return predicate(a) ? [a] : null;
}).reduce(function (prev, current) {
return current ? prev.concat(current) : prev;
}, []);
function filter2 (predicate, list) {
return list.reduce(function (prev, current) {
View gist:5148443
Watching Amanda Palmer's talk the other day (, reminded me I was going to personally thank everyone who's bough Why programmers work at night. But I got lazy :(
Thanks for being awesome!
And if you've read the book already, I'd love to hear what's missing.
View gist:4772958
# this is the reequest body as per dashboard
"card_uri": null,
"meta": null,
"email_address": "",
"name": null
View gist:4771602
buyer = Balanced::Account.find customer_token
if seller.customer_token.nil? || seller.customer_token =~ /cus_/
puts 'creating seller and setting token'
# this throws error
seller_account = Balanced::Marketplace.my_marketplace.create_account(:email_address =>
puts "I got this!"
seller_merchant_uri = seller_account.uri
seller.customer_token = seller_merchant_uri
puts 'seller token'
View gist:4541212
var v;
switch ( $(this).val() ) {
case 'tru':
v = true;
case 'fls':
v = false;
case 'null':
View gist:3323937
Couldn't match expected type `([Char], [Char])'
with actual type `[[Char]]'
Expected type: [([Char], [Char])]
Actual type: [[[Char]]]