This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
const flamelink = require('flamelink/app'); | |
// Only import the modules that you need (change `cf` to `rtdb` for Realtime DB) | |
require('flamelink/cf/settings'); | |
require('flamelink/cf/content'); | |
require('flamelink/cf/storage'); | |
require('flamelink/cf/navigation'); | |
require('flamelink/cf/users'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git fetch -p && git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Modern Font Stacks */ | |
/* System */ | |
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif; | |
/* Times New Roman-based serif */ | |
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; | |
/* A modern Georgia-based serif */ | |
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
exports.addCustomClaim = functions.database.ref('/flamelink/environments/production/content/userAccount/en-US/{entryId}') | |
.onCreate((snapshot, context) => { | |
const entry = snapshot.val(); | |
const entryId = context.params.entryId; | |
const uid = entry.uid; | |
// user creating the new entry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const flamelink = require('flamelink') | |
const admin = require('firebase-admin'); | |
const firebaseApp = admin.initializeApp(functions.config().firebase); | |
const app = flamelink({ firebaseApp, isAdminApp: true }); | |
exports.addMessage = functions.https.onRequest((req, res) => { | |
return app.content.get('messages') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rules": { | |
"flamelink": { | |
".read": "root.child('flamelink').child('users').child(auth.uid).child('enabled').val() === 'Yes'", | |
".write": "root.child('flamelink').child('users').child(auth.uid).child('enabled').val() === 'Yes'", | |
"environments": { | |
"$environment": { | |
"content": { | |
"$contentType": { | |
"$locale": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"timestamp":1530093891101,"data":{"appernetic":[{"timestamp":1530093891101,"followers":3504}],"bowtie":[{"timestamp":1530093891101,"followers":4}],"builtio":[{"timestamp":1530093891101,"followers":1387}],"butter-cms":[{"timestamp":1530093891101,"followers":278}],"cannerio-cms":[{"timestamp":1530093891101,"followers":55}],"cloudcannon":[{"timestamp":1530093891101,"followers":1110}],"cloud-cms":[{"timestamp":1530093891101,"followers":252}],"cockpit":[{"timestamp":1530093891101,"followers":676,"stars":3074,"forks":303,"issues":171}],"coisas":[{"timestamp":1530093891101,"stars":244,"forks":17,"issues":0}],"contenta":[{"timestamp":1530093891101,"followers":738,"stars":183,"forks":56,"issues":32}],"contentful":[{"timestamp":1530093891101,"followers":33865}],"cosmic-js":[{"timestamp":1530093891101,"followers":4122}],"daptin":[{"timestamp":1530093891101,"stars":173,"forks":7,"issues":13}],"datocms":[{"timestamp":1530093891101,"followers":389}],"directus":[{"timestamp":1530093891101,"followers":16484,"stars":3176,"fo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const double = x => x * 2; | |
const square = x => x * x; | |
const plus3 = x => x + 3; | |
const composedFunction = compose(double, square, plus3); | |
const result = composedFunction(2); | |
// result = 50 | |
// 2 (plus3) => 5 (square) => 25 (double) => 50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pipe = (…functions) => input => functions.reduce((chain, func) => chain.then(func), Promise.resolve(input)); | |
// Functions fn1, fn2, fn3 can be standard synchronous functions or return a Promise | |
pipe(fn1, fn2, fn3)(input).then(result => console.log(`Do with the ${result} as you please`)) |
NewerOlder