Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Qiang Li liqiang372

🎯
Focusing
Block or report user

Report or block liqiang372

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@liqiang372
liqiang372 / main.js
Created Apr 26, 2018
comparison of lazy evaluation
View main.js
const _ = require('lodash');
const t = require('transducers.js');
const arrayofRandoms = randomCeil => length =>
Array.from({length: length}, (v, i) =>
Math.floor(Math.random() * randomCeil));
const arrOfMillion = arrayofRandoms(100)(1e6);
const tripleIt = (el) => el * 3;
@liqiang372
liqiang372 / dummy_file.js
Last active Feb 9, 2017
for enhui study
View dummy_file.js
var x = 1;
console.log("whatever")
@liqiang372
liqiang372 / preview.css
Created Oct 14, 2016
Add github markdown style to quiver preview mode
View preview.css
h1,h2{padding-bottom:.3em;border-bottom:1px solid #eee}*{font-size:16px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";line-height:1.5;word-wrap:break-word}blockquote,dl,ol,p,pre,table,ul{margin-top:0;margin-bottom:16px}h1,h2,h3,h4,h5,h6{margin-top:24px;margin-bottom:16px;line-height:1.25}h1{font-size:2em}h2{font-size:1.5em}h3{font-size:1.25em}h4{font-size:1em}h5{font-size:.875em}h6{font-size:.85em;color:#777}pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}pre *{background:#f7f7f7}a{color:#4078c0;text-decoration:none}a:hover{text-decoration:underline}code::after,code::before{letter-spacing:-.2em;content:"\00a0"}
View pubsub.js
function Pubsub() {
this.events = {};
}
Pubsub.prototype.publish = function(event, args) {
if (!this.events[event]) {
return false;
}
var subscribers = this.events[event];
View observer.js
// This is the object that once its state changes,
// it will notify all the observers.
function Observable() {
this.observersList = [];
}
Observable.prototype.addObserver = function(observer) {
this.observersList.push(observer);
}
Observable.prototype.removeObserver = function (observer) {
var self = this;
@liqiang372
liqiang372 / andtestfile.js
Last active Feb 9, 2017
get cursor position on web
View andtestfile.js
// this is a test file indeed
You can’t perform that action at this time.