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
| <div class="container"> | |
| <div class="background"></div> | |
| <div class="content"> | |
| <div class="logo"> | |
| <img | |
| src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODgiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTc4LjA1IDE1LjE3M2MtNy4yNTEtLjI3NS05LjU3NyA2Ljc5NS05LjU3NyA2Ljc5NS0uMTM3LTIuOTUyLjA2OS00Ljg3NC4wNjktNC44NzQuNDEtLjI3NCA2LjU2Ni0yLjY3NyA2LjkwOC0xMC45ODIuMTM3LTQuNTMtMy42MjUtNy4xMzktOC4wMDMtNS42OTctMS42NDEgNy41NS0zLjIxNSAxNy44NDctMS44NDcgMjguNjIzLS4yNzMuODI0LTIuNzM1IDYuODY0LTUuNDAzIDYuODY0LTMuNjI2IDAtNC4yNDEtNy40ODItNC4xMDQtMTIuMzU1LjgyLTEuNzg1IDIuNTMtNi4wNCAxLjA5NC03Ljc1Ny0uNjg0LS44OTItMi4wNTItMS4wMy00LjEwNC0uNjE3IDAgLjQ4LS4xMzcgMy43MDYtLjEzNyAzLjcwNnMtMS43NzgtMy4zNjMtNi4xNTYtMy4zNjNjLTYuMjkyIDAtMTAuMzk2IDYuMTA5LTEwLjM5NiAxMi40OTMgMCAxLjAzLjA2OCAxLjkyMS4xMzYgMi44MTRsLjA2OS4wNjgtLjA2OS4wNjljLTEuNzEgMy4xNTgtMy4yODMgNC43MzYtNS4zMzUgNC43MzYtNC40NDYgMC00Ljk5My02Ljg2NC00Ljk5My02Ljg2NCA0LjE3Mi00Ljk0MiA2LjQzLTExLjg3NSA2LjQzLTE5LjQyNSAwLTYuMjQ3LTIuNzM2LTEwLjg0Ni04LjM0NS04Lj |
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 debugScrolling() { | |
| /* eslint-disable func-names, no-debugger, no-console, prefer-rest-params */ | |
| const fnOnScroll = function(reason) { | |
| console.log(reason); | |
| debugger; | |
| }; | |
| // scrollIntoView, scrollIntoViewIfNeeded, scrollTo | |
| const scrollMethods = [ | |
| 'scrollIntoView', | |
| 'scrollIntoViewIfNeeded', |
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
| ioredis git:2.x ❯ node testgc.js ✭ | |
| { rss: 39206912, heapTotal: 18550784, heapUsed: 10817576 } | |
| { rss: 42131456, heapTotal: 28858112, heapUsed: 14043976 } | |
| { rss: 45133824, heapTotal: 29890048, heapUsed: 17801240 } | |
| { rss: 48730112, heapTotal: 30921984, heapUsed: 16971152 } | |
| { rss: 52207616, heapTotal: 30921984, heapUsed: 20462008 } | |
| { rss: 55001088, heapTotal: 34017792, heapUsed: 20058632 } | |
| { rss: 55132160, heapTotal: 34017792, heapUsed: 23546144 } | |
| { rss: 58257408, heapTotal: 52592640, heapUsed: 23160232 } | |
| { rss: 59060224, heapTotal: 52592640, heapUsed: 26676264 } |
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 redis = require('redis'); | |
| var options = { | |
| host: '127.0.0.1', | |
| port: '6379' | |
| }; | |
| var publisher = redis.createClient(options); | |
| var subscriber = redis.createClient(options); | |
| function sub(message) { |
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
| s1, s2 and s3 are operations in the server, and c1, c2 are operations performed on the client. | |
| s1 s2 s3 | |
| c1 c2 | |
| 1. transform(c1, s1) = (c1', s1') => c1 s1' = s1 c1' | |
| 2. transform(c1', s2) = (c1'', s2') => c1' s2' = s2 c1'' | |
| 3. transform(c1'', s3) = (c1''', s3') => c1'' s3' = s3 c1''' |
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
| // Let express support "Promise" | |
| app.use(function(req, res, next) { | |
| var oldResJson = res.json; | |
| res.json = function(promise) { | |
| if (promise && | |
| typeof promise === 'object' && | |
| typeof promise.success === 'function') { | |
| promise.success(function(fetchedObj) { | |
| if (fetchedObj) { | |
| oldResJson.call(res, fetchedObj); |
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.prototype.unCurrying = function () { | |
| var self = this; | |
| return function () { | |
| var args = Array.prototype.slice.call(arguments); | |
| return self.apply(args[0], args.slice(1)); | |
| }; | |
| }; | |
| var foo = []; | |
| var push = Array.prototype.push.unCurrying(); |
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 Pool = function (poolSize, taskHandler) { | |
| this.poolSize = poolSize; | |
| this.taskHandler = taskHandler; | |
| this.free = poolSize; | |
| this.offlineTasks = []; | |
| }; | |
| Pool.prototype.check = function () { | |
| if (this.offlineTasks.length > 0 && this.free > 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
| angular.module('projectServices', []) | |
| .factory 'User', -> | |
| @authenticated = false | |
| @name = null | |
| isAuthenticated: => @authenticated | |
| getName: => @name | |
| login: (username, password, callback) => | |
| $.post '/login', | |
| {username: username, password: password}, | |
| ((data) => |
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 iterators (list) { | |
| var index = 0; | |
| return function () { | |
| return list[index++]; | |
| } | |
| } | |
| var v; | |
| var str = "hello world!"; |
NewerOlder