$ npm install -g create-react-app
$ create-react-app my-app
// Example card. | |
// User-editable properties for this card: | |
export const PROPS = [ | |
propNumber("ticks", 60), | |
propBoolean("infinite", true), | |
propBoolean("completeAnimationDelay", false), | |
propNumber("completeAnimationDelayMin", 60), | |
propNumber("completeAnimationDelayMax", 60), | |
propNumber("forceFrame", -1) |
When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).
When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.
Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.
So let's go through the one query that's worth memorizing to handle your eager loading.
var queryParams = window.location.search.substr(1).split('&').reduce(function (qs, query) { | |
var chunks = query.split('='); | |
var key = chunks[0]; | |
var value = decodeURIComponent(chunks[1] || ''); | |
var valueLower = value.trim().toLowerCase(); | |
if (valueLower === 'true' || value === 'false') { | |
value = Boolean(value); | |
} else if (!isNaN(Number(value))) { | |
value = Number(value); | |
} |
#!/usr/bin/python | |
import hashlib, sys | |
# Simplified version of https://github.com/drupal/drupal/blob/7.x/includes/password.inc | |
ALGO = hashlib.sha512 | |
ITOA64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' # ICHS |
#!/usr/bin/env python | |
# Source: http://code.activestate.com/recipes/325905-memoize-decorator-with-timeout/#c1 | |
import time | |
from functools import wraps | |
class MWT: | |
"""Memoize With Timeout""" | |
_caches = {} | |
_timeouts = {} |
# In big teams instead of specifying one email to rule them all as apple_id | |
# You can get this information from environment variable | |
# By doing this it will allow different developers to specify their own apple ids | |
# And if this env variable is not required - then it will be asked on any command that requires apple_id | |
apple_id ENV["MY_APP_NAME_APPLE_ID"] # Your Apple email address | |
### ~/.bashrc of some user | |
export MY_APP_NAME_APPLE_ID="[email protected]" | |
{ | |
"AWSEBDockerrunVersion": "1", | |
"Image": { | |
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>", | |
"Update": "true" | |
}, | |
"Ports": [ | |
{ | |
"ContainerPort": "443" | |
} |
Go to the egghead website, i.e. Building a React.js App
run
$.each($('h4 a'), function(index, video){
console.log(video.href);
});
var Headout = { | |
apply: function() { | |
return true; | |
}, | |
code: function() { | |
console.log("I", this.a.join(' '), 'code at Headout'); | |
this.a = []; | |
return this; | |
}, | |
a: [] |