This file contains 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/modules/Analytics.jsx | |
var React = require('react'); | |
var Fluxxor = require('fluxxor'); | |
var FluxMixin = Fluxxor.FluxMixin(React); | |
var paths = require('../helpers/paths'); | |
var Analytics = React.createClass({ | |
displayName: 'Analytics', | |
mixins: [FluxMixin], |
This file contains 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 ModuleParserHelpers = require('webpack/lib/ModuleParserHelpers'); | |
var NullFactory = require('webpack/lib/NullFactory'); | |
var _ = require('lodash'); | |
var path = require('path'); | |
var sass = require('node-sass'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var ExtractTextPlugin__dirname = path.dirname( | |
require.resolve('extract-text-webpack-plugin')); | |
var visited = {}; |
This file contains 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
//quickly test the react-router route configurations | |
//npm i babel | |
//babel RouterTest.jsx | node | |
var React = require('react'); | |
var Router = require('react-router'); | |
var Route = Router.Route; | |
var RouteHandler = Router.RouteHandler; | |
var DefaultRoute = Router.DefaultRoute; | |
var NotFoundRoute = Router.NotFoundRoute; |
This file contains 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 TicTacToe = React.createComponent({ | |
getInitialState: function(){ | |
return { | |
board : [ | |
['', '', ''], | |
['', '', ''], | |
['', '', ''], | |
], | |
turn: 'x' |
This file contains 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
// clubs (♣), diamonds (♦), hearts (♥) and spades (♠) | |
var cards = []; | |
var suits = ['♣', '♦', '♥', '♠']; | |
var numbers = ['A', 'K', 'Q', 'J', | |
'10', '9', '8', '7', | |
'6', '5', '4', '3', | |
'2' | |
]; |
This file contains 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
new y hardware 51.50 | |
< 7:48:02 PM: echo: M92 X84.06 Y83.88 Z2020.00 E98.80 | |
(old steps value * software move) / hardware move = new steps value | |
83.88 * 50 / 51.50 = 81.43 | |
< 8:54:16 PM: echo: M92 X84.06 Y81.43 Z2020.00 E98.80 |
This file contains 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
[debug] [iOSSim] Building bundle path map | |
[iOS] Error: ENOENT: no such file or directory, scandir '/Users/4m1r/Library/Developer/CoreSimulator/Devices/87A53418-4DB5-43FF-8EF7-170CA6640AFB/data/Containers/Containers/Data/Application' | |
at Error (native) | |
{ [Error: ENOENT: no such file or directory, scandir '/Users/4m1r/Library/Developer/CoreSimulator/Devices/87A53418-4DB5-43FF-8EF7-170CA6640AFB/data/Containers/Containers/Data/Application'] | |
cause: | |
{ [Error: ENOENT: no such file or directory, scandir '/Users/4m1r/Library/Developer/CoreSimulator/Devices/87A53418-4DB5-43FF-8EF7-170CA6640AFB/data/Containers/Containers/Data/Application'] | |
errno: -2, | |
code: 'ENOENT', | |
syscall: 'scandir', | |
path: '/Users/4m1r/Library/Developer/CoreSimulator/Devices/87A53418-4DB5-43FF-8EF7-170CA6640AFB/data/Containers/Containers/Data/Application' }, |
This file contains 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
// async_series.js | |
// example of using reduce with promises and closure to create async results in series | |
var q = require('Q'); | |
var results = [1, 2, 3, 4, 5]; | |
function workCollection(arr) { | |
return arr.reduce(function(promise, item, index) { |
This file contains 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
<script type="text/javascript"> | |
(function(){ | |
var timestamp = 0; | |
var client = new XMLHttpRequest(); | |
var interval = setInterval(setRefresh, 500); | |
console.log('setting refresh interval id...', interval); | |
function getTimestamp(callback) { | |
client.open("HEAD", "http://localhost:8001/archer/dist/app.js", true); |
This file contains 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
// sudoku board checker | |
function validateSet(row) { | |
var hash = {}; | |
if(row.length === 9) { | |
for(var idx = 0; idx < row.length; idx++) { | |
hash[row[idx]] = row[idx]; | |
} |