- Labels Detection
- Faces Detection
- Faces Comparison
- Faces Indexing
- Faces Search
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
{ | |
"auto_complete_triggers": | |
[ | |
{ | |
"characters": "<", | |
"selector": "text.html" | |
}, | |
{ | |
"characters": ".", | |
"selector": "source.js" |
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 header = document.querySelector('.header'); | |
const pageWrap = document.querySelector('.wrapper'); | |
var lastScrollTop = 0; | |
function debounce(func, wait) { | |
let timeout; | |
return function(...args) { | |
const context = this; | |
clearTimeout(timeout); | |
timeout = setTimeout(() => func.apply(context, args), wait); |
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
Hey, | |
This is the redux video series that helped me learn how to use it: https://egghead.io/courses/getting-started-with-redux. And here's a section on react "stateless functions": https://facebook.github.io/react/docs/reusable-components.html#stateless-functions | |
Later you might want to play around with React Native | |
React Native for Web: https://github.com/necolas/react-native-web | |
Try it out here: http://codepen.io/necolas/pen/PZzwBR/?editors=0010 | |
And I thought you might get some ideas from what we're doing for mobile.twitter.com, which is a bit like this... |
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
import React from 'react' | |
import { observer } from 'mobx-react' | |
import { func, bool } from 'prop-types' | |
// Separate local imports from dependencies | |
import './styles/Form.css' | |
// Declare propTypes here, before the component (taking advantage of JS function hoisting) | |
// You want these to be as visible as possible | |
ExpandableForm.propTypes = { | |
onSubmit: func.isRequired, |
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 Facebook = require('Facebook'); | |
exports.handler = (event, context, callback) => { | |
/* ... | |
Get messaging event // see https://gist.github.com/alexandrenicol/f01f867cb175cd89e3e100c508cc6f4a#file-index-js | |
... */ | |
// Iterate over each messaging event | |
entry.messaging.forEach(function(event) { | |
if (event.message) { | |
const message = event.message.text; | |
const senderID = event.sender.id; |
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
import { h, Component } from 'preact'; | |
/** Creates a new store, which is a tiny evented state container. | |
* @example | |
* let store = createStore(); | |
* store.subscribe( state => console.log(state) ); | |
* store.setState({ a: 'b' }); // logs { a: 'b' } | |
* store.setState({ c: 'd' }); // logs { c: '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
// π₯ Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('β'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
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
exports.updateFeed = functions.database.ref('/stories/{userId}/{storyId}').onWrite(event => { | |
const userId = event.params.userId; | |
const storyId = event.params.storyId; | |
let followersRef = admin.database().ref('/followers/'+userId); | |
if(!event.data.val()){ | |
//post was deleted | |
followersRef.once("value", function(snap) { | |
snap.forEach(function(childSnapshot) { | |
let followerId = childSnapshot.key; |
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
#!/usr/bin/env node | |
const request = require('request'); | |
const AWS = require('aws-sdk'); | |
const rekognition = new AWS.Rekognition({ | |
// Detect moderation labels is available on AWS region us-east-1, us-west-2 and eu-west-1 | |
region: "us-west-2", | |
accessKeyId: "YOUR accessKeyId", | |
secretAccessKey: "YOUR secretAccessKey" |