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
| if ( document.getElementById('hot-network-questions') !== null ){ | |
| var buzzfeed = document.getElementById('hot-network-questions'); | |
| buzzfeed.remove(); | |
| } |
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
| { | |
| "name": "my-stormpath-project", | |
| "version": "1.0.0", | |
| "dependencies": { | |
| "basic-auth": "^1.0.0", | |
| "bluebird": "^2.9.24", | |
| "config": "^1.13.0", | |
| "discourse-sso": "^1.0.2", | |
| "express": "^4.12.3", | |
| "express-stormpath": "^1.0.4", |
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(grunt) { | |
| require('load-grunt-tasks')(grunt); | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| express: { | |
| dev: { | |
| options: { | |
| script: 'app.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
| var config = require('config'), | |
| express = require('express'), | |
| stormpath = require('express-stormpath'); | |
| var app = express(); | |
| var httpAuth = require('./middlewares/basic-auth'); | |
| app.all('/*', httpAuth('a-username', 'a-password'), function(req, res, next) { | |
| res.locals.user = req.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
| var auth = require('basic-auth'); | |
| /** | |
| * Simple basic auth middleware for use with Express 4.x. | |
| * via http://www.danielstjules.com/2014/08/03/basic-auth-with-express-4/ | |
| * | |
| * @param {string} username Expected username | |
| * @param {string} password Expected password | |
| * @returns {function} Express 4 middleware requiring the given credentials | |
| */ |
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 Card = React.createClass({ | |
| componentDidMount: function() { | |
| $(document).foundation(); | |
| }, | |
| render: function() { | |
| var cx = React.addons.classSet; | |
| var titleClasses = cx({ | |
| 'project-title': true, | |
| 'medium-centered': true, | |
| 'small-centered': true, |
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 Deck = React.createClass({ | |
| render: function() { | |
| var cardList = this.props.data.map(function (card) { | |
| return ( | |
| <Card data={card} /> | |
| ); | |
| }); | |
| return ( | |
| <div className="deck"> | |
| {cardList} |
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 Dealer = React.createClass({ | |
| loadCardInfoFromServer: function() { | |
| $.ajax({ | |
| url: this.props.url, | |
| dataType: 'json', | |
| success: function(data) { | |
| this.setState({data: data}); | |
| }.bind(this), | |
| error: function(xhr, status, err) { | |
| console.error(this.props.url, status, err.toString()); |
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
| label | count | |
|---|---|---|
| Monday | 379130 | |
| Tuesday | 424923 | |
| Wednesday | 430728 | |
| Thursday | 432138 | |
| Friday | 428295 | |
| Saturday | 368239 | |
| Sunday | 282701 |
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 'minitest/autorun' | |
| class RobotTest < MiniTest::Unit::TestCase | |
| def test_name_sticks | |
| robot = Robot.new | |
| robot.name | |
| assert_equal robot.name, robot.name | |
| end | |
| end |