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 async = require('async'); | |
var apiMethod = function(callback) { | |
console.info('apiMethod.arguments', callback); | |
// callback returns error | |
return callback(123); | |
// callback return ok | |
return callback(123); | |
} |
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(document, $, angular) { | |
var app = angular.module('inklocker.directives'); | |
/* @description | |
* Usage: | |
* | |
* | |
* | |
* | |
* */ |
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
// http://momentjs.com/docs/#/query/is-between/ | |
// Version 2.13.0 introduces inclusivity. | |
// A [ indicates inclusion of a value. A ( indicates exclusion. | |
// If the inclusivity parameter is used, both indicators must be passed. | |
moment('2016-10-30').isBetween('2016-10-30', '2016-12-30', null, '()'); //false | |
moment('2016-10-30').isBetween('2016-10-30', '2016-12-30', null, '[)'); //true | |
moment('2016-10-30').isBetween('2016-01-01', '2016-10-30', null, '()'); //false | |
moment('2016-10-30').isBetween('2016-01-01', '2016-10-30', null, '(]'); //true | |
moment('2016-10-30').isBetween('2016-10-30', '2016-10-30', null, '[]'); //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 async = require('async'); | |
_ = require('lodash'); | |
var DATA = [ | |
{ id: 1, name: 'One', group: 'One' }, | |
{ id: 4, name: 'Trr', group: 'Two' }, | |
{ id: 3, name: 'Rtt', group: 'Three' }, | |
{ id: 4, name: 'Vbb', group: 'Two' }, | |
{ id: 8, name: 'Ncc', group: 'One' }, | |
{ id: 6, name: 'Onaaa', group: 'Three' }, |
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
// http://fastcodenote.blogspot.com.by/2013/09/nodejs-async.html | |
var async = require('async'); | |
_ = require('lodash'); | |
var DATA = [ | |
{ id: 1, name: 'One', group: 'One' }, | |
{ id: 2, name: 'Trr', group: 'Two' }, | |
{ id: 3, name: 'Rtt', group: 'Three' }, | |
{ id: 4, name: 'Vbb', group: 'Two' }, | |
{ id: 5, name: 'Ncc', group: 'One' }, |
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.all('/*', function(req, res, next) { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header("Access-Control-Allow-Headers", "X-Requested-With"); | |
next(); | |
}); |
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 r = 480, | |
format = d3.format(",d"), | |
fill = d3.scale.category20c(); | |
var keeper; | |
var bubble = d3.layout.pack() | |
.sort(null) | |
.size([r, r]); |
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
angular.module('demo').service('imageService', function ($http, $q, $timeout) { | |
var NUM_LOBES = 3 | |
var lanczos = lanczosGenerator(NUM_LOBES) | |
// resize via lanczos-sinc convolution | |
this.resize = function (img, width, height) { | |
var self = { } | |
self.type = "image/png" | |
self.quality = 1.0 |
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 WebSocketServer = require('ws').Server | |
, http = require('http') | |
, express = require('express') | |
, path = require('path') | |
, net = require('net') | |
, app = express() | |
, adb = require('adbkit') | |
, childProcess = require('child_process') | |
, json = require('JSON') | |
, fs = require('fs') |
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
package Fake::Component::Node; | |
use strict; | |
use utf8; | |
use base 'Class::Accessor::Fast'; | |
__PACKAGE__->mk_accessors(qw/max/); | |
sub get_current_row_data { | |
my ($self,$id) = @_; | |
my $i = 0; | |
return { row => 1 } unless $id; |