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) { | |
| grunt.initConfig({ | |
| jshint: { | |
| files: [], | |
| }, | |
| watch: { | |
| files: ['src/**/*.js'], | |
| tasks: ['jshint'] | |
| } | |
| }); |
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.js').get(process.env.NODE_ENV); | |
| var config = { | |
| production: { | |
| session: { | |
| key: 'the.express.session.id', | |
| secret: 'something.super.secret' | |
| }, | |
| database: 'mongodb://<user>:<pwd>@apollo.modulusmongo.net:27017/db', | |
| twitter: { |
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 listenForBothEventsHandler = (function(){ | |
| // save fired events in closure | |
| var firstEventFired = false; | |
| var secondEventFired = false; | |
| // return function - the actual event handler function | |
| return function(event){ | |
| if(event === 'first'){ | |
| firstEventFired = 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 Rx = require('rx'), | |
| EventEmitter = require('events').EventEmitter, | |
| i = 0; | |
| var eventEmitter = new EventEmitter(); | |
| var source = Rx.Observable.fromEvent(eventEmitter, 'data') | |
| var subscription = source.subscribe(function(data) { | |
| process.nextTick(function() { |
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 strict'; | |
| var Rx = require('rx'); | |
| var EventEmitter = require('events').EventEmitter; | |
| var inputs = { // defaults | |
| x: -2, | |
| y: 5, | |
| z: -4, | |
| h: 0.001 |
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 request = require('request'); | |
| var fs = require('fs'); | |
| var data = { | |
| first_name: "Matthias", | |
| last_name: "Gattermeier", | |
| email: "[email protected]", | |
| position_id: "JS", | |
| explanation: "I'm using the npm request module to send the request. Code here in the gist: https://gist.github.com/Gattermeier/c0bcac33df6994813be2", | |
| projects: ["https://github.com/Gattermeier/nodejs-virus", "https://gist.github.com/Gattermeier/8c3f99ddeb75aa995c27", "https://chrome.google.com/webstore/detail/oxidizer/mjfdkgkfbceiiakhblgkcofjfoninggj", "http://www.gattermeier.net"], |
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
| wget https://nodejs.org/dist/v5.1.0/node-v5.1.0-linux-armv7l.tar.gz | |
| tar xvf node-v5.1.0-linux-armv7l.tar.gz | |
| echo 'export PATH=$PATH:/$HOME/node-v5.1.0-linux-armv7l/bin' >> ~/.profile |
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
| // Cluster | |
| import cluster from 'cluster'; | |
| const numCPUs = require('os').cpus().length; | |
| // Hapi | |
| import Hapi from 'hapi'; | |
| import hapiReactViews from 'hapi-react-views'; | |
| // Load our module configuration | |
| import hapiModuleConfig from './hapi.modules'; |
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 ExternalClass { | |
| constructor(someClassInstance, variable) { | |
| this.someClassInstance = someClassInstance; | |
| this.variable = variable; | |
| } | |
| } | |
| class SomeClass { | |
| constructor() { |
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 { createRenderer } from 'react-addons-test-utils'; | |
| import createComponent from 'react-unit'; | |
| import tape from 'tape'; | |
| import addAssertions from 'extend-tape'; | |
| import jsxEquals from 'tape-jsx-equals'; | |
| const test = addAssertions(tape, {jsxEquals}); | |
| // Component to test | |
| import Button from '../components/Button'; |
OlderNewer