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 Immutable from 'immutable' | |
import { LOGIN, LOGIN_SUCCESS, LOGIN_FAILURE } from 'actions/authentication' | |
const initialState = Immutable.Map({ loggedIn: false, loggingIn: false }) | |
export default function authenticationReducer (state = initialState, action) { | |
const pending = state.merge({ loggedIn: false, loggingIn: true }) | |
const success = state.merge({ loggedIn: true, loggingIn: false, token: action.payload.token }) | |
const failure = state.merge({ loggedIn: false, loggingIn: false, error: action.error }) |
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 { connect } from 'react-redux' | |
import { login } from 'actions/authentication' | |
export default function (Component) { | |
const Authenticated = React.createClass({ | |
componentWillMount () { | |
if (!this.props.loggedIn) this.props.login(null, null, this.props.route.path) | |
}, |
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
# A better prefix | |
unbind-key C-b | |
set -g prefix 'C-a' | |
bind-key 'C-a' send-prefix | |
# Use reattach-to-user-namespace to fix clipboard issues | |
set-option -g default-command "reattach-to-user-namespace -l zsh" | |
set-environment -g TMUX_COMMAND tmux |
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 BASE_URL = "http://cheersfrom.bamcreative.com/image.php?name=" | |
var foreach = require('for-each') | |
var request = require('request') | |
var temp = require('temp') | |
var async = require('async') | |
var gm = require('gm') | |
// Requires graphicsmagick by way of a simple "brew install graphicsmagick" | |
temp.track() |
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 BASE_URL = "http://cheersfrom.bamcreative.com/image.php?name=" | |
var foreach = require('for-each') | |
var request = require('request') | |
var temp = require('temp') | |
var async = require('async') | |
var gm = require('gm') | |
temp.track() | |
function getLetter(letter, cb) { |
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 BASE_URL = "http://cheersfrom.bamcreative.com/image.php?name=" | |
var foreach = require('for-each') | |
var request = require('request') | |
var temp = require('temp') | |
var async = require('async') | |
var gm = require('gm') | |
temp.track() | |
function getLetter(letter, cb) { |
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 { Route } from 'react-router' | |
import SchemaFormRoute from './routes/schema-form-route' | |
import Application from './handlers/Application' | |
import Example from './handlers/example' | |
import SimpleExample from './handlers/simple-example' | |
export default ( | |
<Route path='/' component={Application}> | |
<Route path='/foo**' component={SimpleExample} /> |
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 Immutable from 'immutable' | |
import { GET_VIDEOS, GET_VIDEO } from 'actions/videos' | |
export default function videos (state = Immutable.Map(), action) { | |
switch (action.type) { | |
case GET_VIDEO: | |
return state.updateIn([action.meta.id], Immutable.Map(), video => { | |
if (action.pending) return video.set('loading', true) | |
if (action.error) return video.set('loading', false) | |
return Immutable.fromJS(action.payload).set('loading', false) |
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
{"https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&key=AIzaSyCY4s9trcdWHZXj724K1h7m7q9SFOb2tRE&playlistId=UUANLZYMidaCbLQFWXBC95Jg":{"kind":"youtube#playlistItemListResponse","etag":"\"mPrpS7Nrk6Ggi_P7VJ8-KsEOiIw/n3C-I5pM6PITLrpZZwaW2JwVWV0\"","nextPageToken":"CAUQAA","pageInfo":{"totalResults":70,"resultsPerPage":5},"items":[{"kind":"youtube#playlistItem","etag":"\"mPrpS7Nrk6Ggi_P7VJ8-KsEOiIw/YiYlScgTdXQKktZkENRA8JmxkqY\"","id":"UUBoRzWBBNef9W1g_TsBuKMsqPgpEgOaP6","contentDetails":{"videoId":"IdneKLhsWOQ"}},{"kind":"youtube#playlistItem","etag":"\"mPrpS7Nrk6Ggi_P7VJ8-KsEOiIw/Bwiok7AVDjSunC6ms9ednnDMlOQ\"","id":"UUBoRzWBBNef_n8ARpaV4HvIyftnF676fj","contentDetails":{"videoId":"QcIy9NiNbmo"}},{"kind":"youtube#playlistItem","etag":"\"mPrpS7Nrk6Ggi_P7VJ8-KsEOiIw/oOSf67z7zLme181QdJD-yBwXkGY\"","id":"UUBoRzWBBNef_g_fL0mRabMLoTIdluh_iW","contentDetails":{"videoId":"-CmadmM5cOk"}},{"kind":"youtube#playlistItem","etag":"\"mPrpS7Nrk6Ggi_P7VJ8-KsEOiIw/HexU1ebqR8qHbqMWIPcRU74SFJQ\"","id":"UUBoRzWBB |