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
class API::BaseController < ApplicationController | |
respond_to :json | |
before_action :set_default_format, :assert_valid_format!, :authenticate_from_token!, :authenticate_client! | |
protected | |
def authenticate_from_token! | |
token = request.headers['X-Authentication-Token'] | |
id = request.headers['X-Authentication-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
App.Router.map -> | |
@resource 'schedules', -> | |
@resource 'schedule', { path: '/:schedule_id' }, -> | |
@resource 'events' | |
App.EventsRoute = Ember.Route.extend | |
model: -> | |
@modelFor('schedule').get('events') | |
App.Schedule = DS.Model.extend |
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
require 'net/http' | |
class Avatar | |
attr_accessor :email, :response | |
def initialize(email) | |
@email = email | |
end | |
def self.default_urls |
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 = { | |
entry: './example/main.js', | |
output: { | |
filename: './build/bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{test: /\.js$/, loader: 'jsx-loader'} | |
] | |
} |
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
// 1. Components load for the first time. | |
// 2. An action causes the node to be removed. | |
// 1. Element will enter the DOM | |
componentWillEnter: function(callback) { | |
callback(); | |
console.log('will enter'); | |
}, | |
// // 1. Element is now in the DOM |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://fb.me/react-with-addons-0.12.0.js"></script> | |
<meta charset="utf-8"> | |
<title>React JS quick start guide</title> | |
<style id="jsbin-css"> | |
body { | |
margin: 0; | |
background: #E8E8E8; |
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
"scripts": { | |
"start": "npm run webpack & npm run serve", | |
"webpack": "webpack -w", | |
"serve": "cd example && python -m SimpleHTTPServer" | |
} |
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 React = { | |
Children: { | |
map: ReactChildren.map, | |
forEach: ReactChildren.forEach, | |
count: ReactChildren.count, | |
only: onlyChild | |
}, | |
Component: ReactComponent, | |
DOM: ReactDOM, |
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
// WebUtils | |
WebUtils = { | |
fetchMe: function(opts) { | |
return new Promise(function(resolve, reject) { | |
request.get(`${SOUNDCLOUD_URL}/me`) | |
.query(opts) | |
.end((err, res) => { me: res.body }); | |
} | |
}); | |
} |
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 'babel/polyfill'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Router, Route } from 'react-router'; | |
import { reduxRouteComponent, routerStateReducer } from 'redux-react-router'; | |
import { createStore, combineReducers, applyMiddleware, compose } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import BrowserHistory from 'react-router/lib/BrowserHistory'; | |
import routes from '../shared/components/routes'; | |
import * as reducers from '../shared/reducers/index'; |