No, this isn't about render props
I'm going to clean this up and publish it in my newsletter next week!
So react-i18n (not the npm one... one we made at PayPal internally) has this
| #!/bin/bash | |
| # Install docker | |
| apt-get update | |
| apt-get install -y apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| add-apt-repository \ | |
| "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
| $(lsb_release -cs) \ | |
| stable" | |
| apt-get update |
| $(document).ready(function () { | |
| var $btn = $('.btn'); | |
| var $image = $('#img'); | |
| function Filter (config) { | |
| this.target = config.target; | |
| this.image = config.image; | |
| this.filters = config.filters; | |
| this.support = config.support === undefined ? true : config.support; |
| Object.defineProperty(Number.prototype,Symbol.iterator,{ | |
| *value({ start = 0, step = 1 } = {}) { | |
| var inc = this > 0 ? step : -step; | |
| for (let i = start; Math.abs(i) <= Math.abs(this); i += inc) { | |
| yield i; | |
| } | |
| }, | |
| enumerable: false, | |
| writable: true, | |
| configurable: true |
| import NextHead from 'next/head' | |
| import React from 'react' | |
| import ReactGA from 'react-ga' | |
| import Router from 'next/router' | |
| /*****************************************************************************\ |
| import threading | |
| from yattag import Doc | |
| from flask import Flask | |
| js_scripts = [] | |
| app = (Flask(__name__)) | |
| thread = None | |
| def start(host='0.0.0.0', port = 6969): | |
| """Gets app listening on host:port. Call inject before starting the |
No, this isn't about render props
I'm going to clean this up and publish it in my newsletter next week!
So react-i18n (not the npm one... one we made at PayPal internally) has this
| alias gits='git status -s' | |
| alias gitl='git log --oneline' | |
| alias gitc='git commit -m' | |
| alias gita='git add --all' | |
| alias gitp='git push -u origin master' | |
| alias gitd='git diff' | |
| alias gitpl='git pull' | |
| alias gitpb='git push origin' |
| from collections import OrderedDict | |
| import graphene | |
| import rx | |
| subject = rx.subjects.Subject() | |
| class Author(graphene.ObjectType): |
| /* | |
| Using Cloud Functions, here's what I've come up with for anyone who wants to | |
| add a timestamp field in a Firestore document. You need to have the Firebase Admin SDK installed in | |
| addition to the general setup for Cloud Functions as detailed in the Firebase documentation. | |
| */ | |
| const functions = require('firebase-functions'); | |
| // The Firebase Admin SDK to access the Firebase Realtime Database. | |
| const admin = require('firebase-admin'); |
| // In a Firestore standard example, we quickly create a 'xmas tree' of nested stuff | |
| // We use Promises directly: get().then(callback) and use snapshot.forEach() to iterate | |
| let campaignsRef = db.collection('campaigns'); | |
| let activeCampaigns = campaignsRef.where('active', '==', true).select().get() | |
| .then(snapshot => { | |
| snapshot.forEach(campaign => { | |
| console.log(campaign.id); | |
| let allTasks = campaignsRef.doc(campaign.id).collection('tasks').get().then( | |
| snapshot => { | |
| snapshot.forEach(task => { |