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 PureComponent from 'react-pure-render/component'; | |
import { getDisplayName } from '../utils'; | |
function getComponentRequiredProps({ propTypes }) { | |
return Object.keys(propTypes).filter(key => !propTypes[key].isRequired); | |
} | |
export default function(loader = null, ownRequiredProps) { |
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
FROM binarytales/heroku-nodejs | |
ENV NODE_ENV=production | |
WORKDIR /app | |
# Cache npm install | |
COPY package.json . | |
RUN npm install |
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
// Alternative 1 | |
// One function at top-level that returns whatever it needs. | |
// Can be run multiple times, and return different things | |
@firebase(props => { | |
if (!props.projectIndex) { | |
return { | |
projectIndex: `users/${props.authId}/projects`, | |
}; | |
} |
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
#/bin/bash | |
JS_FILES=$(find "$@" -name "*.js*") | |
for FILE in $JS_FILES; do | |
short_name=`basename $FILE` | |
filename="${short_name%.*}" | |
git grep --quiet \/$filename\' 1>/dev/null | |
if [ "$?" == "1" ]; then | |
echo "Should delete: $FILE" | |
fi |
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
var aws = require('aws-sdk'); | |
var cloudFront = new aws.CloudFront(); | |
function getDistributionDomains(distribution) { | |
return distribution.Origins.Items.map(function(origin) { | |
return origin.DomainName; | |
}); | |
} | |
function findBucketDistributions(bucket, callback) { |
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
groupsLoader.load('admins') | |
.then(users => users.map(user => userLoader.set(user.id, user)) |
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
module['exports'] = function echoHttp (hook) { | |
console.log("Console messages are sent to /logs"); | |
console.log(hook.params); | |
console.log(hook.req.path); | |
console.log(hook.req.method); | |
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
# $AZURE_REPO_URL needs to be set in your projects Variables section | |
# and include both username and password, e.g: https://username:[email protected]:443/site.git | |
# Clone Azure repository | |
git clone $AZURE_REPO_URL ~/azure | |
cd ~/azure | |
# Replace repository contents | |
rsync --archive --delete --exclude ".*" ~/clone/public/ . |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
var Reflux = require('reflux') | |
var axios = require('axios') | |
var CategoryStore = Reflux.createStore({ | |
init: function() { | |
this.items = null | |
}, | |
list: function() { | |
var items = this.items |