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')('/tmp/etc/new.conf') |
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 DocumentEdit = React.createClass({ | |
| mixins: [CoerceDocumentMixin, PerfMixin], | |
| .... | |
| }); |
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 items = this.state.items.map(item => { | |
| var data = item.value; | |
| return ( | |
| <Fadeable key={data.id} | |
| onComplete={() => Actions.remove(data.id)} | |
| transition="opacity 0.5s ease-in" | |
| style={{opacity: 0, color: 'red'}}> | |
| <li> |
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
| function SidewaysCallback() { | |
| var cb = null; | |
| return { | |
| listen: function (_cb) { | |
| cb = _cb; | |
| return function () { cb = null; } | |
| }, | |
| trigger: function () { | |
| if (cb === null) { return; } | |
| cb.apply(null, arguments); |
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 errors = require('errors'); | |
| errors.create({ name: 'SaveAndQuit', scope: module.exports }); |
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: { | |
| def: [ ' X', ' ', ' ', 'XXX ', | |
| ' X', ' ', 'XX ', ' X ', | |
| ' XX', ' X ', 'X ', ' ', | |
| ' ', ' XXX', 'X ', ' ' ], | |
| size: 4, | |
| compiled: [ | |
| { max: { x: 4, y: 4 }, | |
| minos: [ 13, 14, 25, 36 ], | |
| shifts: [ [ 14, 25, 36 ], [ 13, 14 ], [ 13, 25, 36 ], [ 13, 36 ] ], |
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 Promise = require('bluebird'), | |
| request = Promise.promisifyAll(require('request')), | |
| extend = require('extend'); | |
| // this would be more appropriately imported from some config file | |
| var defaultOptions = { | |
| /* whatever request options you are using go here */ | |
| url: 'http://jira-url/' | |
| }; |
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 = Promise.promisifyAll(require('request')); | |
| function getIssues() { | |
| return request(options) | |
| .spread(r, body) { | |
| if (r.statusCode !== 200) { | |
| console.log("unsuccessful status code!"); | |
| console.log(body); | |
| return; | |
| } |
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 Promise = require('bluebird'); | |
| var mysql = require('mysql'); | |
| var fs = require('fs'); | |
| var args = process.argv; | |
| // Configure MySql connection | |
| var con = Promise.promisifyAll(mysql.createConnection({ | |
| host: 'localhost', | |
| user: 'friroot', |
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 Promise = require('bluebird'); | |
| modeminit({ | |
| ports: | |
| [ { DEVNAME: '/dev/ttyUSB1', | |
| ID_MODEL: 'E173s 3G broadband stick (modem on)' }, | |
| { DEVNAME: '/dev/ttyUSB0', | |
| ID_MODEL: 'E173s 3G broadband stick (modem on)' }, |