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
System: Host: dima-System-Product-Name Kernel: 4.10.0-42-generic x86_64 (64 bit gcc: 5.4.0) | |
Desktop: Cinnamon 3.4.4 (Gtk 2.24.30) dm: mdm Distro: Linux Mint 18.2 Sonya | |
Machine: Mobo: ASUSTeK model: M4A785T-M v: Rev X.0x Bios: American Megatrends v: 0801 date: 10/14/2009 | |
CPU: Dual core AMD Phenom II X2 550 (-MCP-) cache: 1024 KB | |
flags: (lm nx sse sse2 sse3 sse4a svm) bmips: 12455 | |
clock speeds: min/max: 800/3100 MHz 1: 1900 MHz 2: 1900 MHz | |
Graphics: Card: Advanced Micro Devices [AMD/ATI] Redwood XT [Radeon HD 5670/5690/5730] | |
bus-ID: 01:00.0 chip-ID: 1002:68d8 | |
Display Server: X.Org 1.18.4 drivers: ati,radeon (unloaded: fbdev,vesa) | |
Resolution: [email protected] |
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
const stream = require('stream'); | |
const fs = require('fs'); | |
class EchoStream extends stream.Writable { | |
_write(chunk, enc, next) { | |
console.log(chunk.toString()); | |
next(); | |
} | |
} |
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
license: gpl-3.0 |
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
module.controller('CtrlImplAdvanced', ['$scope', '$controller', function ($scope, $controller) { | |
// Initialize the super class and extend it. | |
angular.extend(this, $controller('CtrlImpl', {$scope: $scope})); | |
// … Additional extensions to create a mixin. | |
}]); |
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
function fibonacci($n) { | |
if (is_int($n)) { | |
return round(pow((sqrt(5)+1)/2, $n) / sqrt(5)); | |
} else { | |
throw new Exception('Value should be an integer'); | |
} | |
} |
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 fs = require('fs'); | |
var files = ['foo.txt', 'bar.txt', 'baz.txt']; | |
var promises = []; | |
for (var i = 0; i < files.length; i++) { | |
promises.push(readFile(files[i])); | |
} |
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
/** | |
* This is module to test. | |
*/ | |
module.exports = { | |
camelCase: function(string) { | |
return string.replace(/-[a-z]/g, function(match) { | |
return match[1].toUpperCase() + match.slice(2); | |
}); | |
}, | |
dashSeparated: function(string) { |
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
describe('findByNavigator()', function() { | |
var geolocator, fnDone, fnFail; | |
beforeEach(function() { | |
geolocator = new Geolocator({language: 'fi'}); | |
}); | |
it('can find user location', function() { | |
var location, address, components; |
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
/** | |
* Jasmine RequestAnimationFrame: a set of helpers for testing funcionality | |
* that uses requestAnimationFrame under the Jasmine BDD framework for JavaScript. | |
*/ | |
;(function() { | |
var index = 0, | |
callbacks = {}; | |
function MockRAF(global) { |
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
describe('run()', function() { | |
var realNextFrame, realCancelFrame; | |
beforeEach(function() { | |
jasmine.clock().install(); | |
jasmine.RequestAnimationFrame.install(); | |
realNextFrame = window.nextFrame; | |
realCancelFrame = window.cancelFrame; | |
window.nextFrame = window.requestAnimationFrame; |
NewerOlder