Skip to content

Instantly share code, notes, and snippets.

View zhouzi's full-sized avatar

Gabin Aureche zhouzi

View GitHub Profile
@tomhicks
tomhicks / plink-plonk.js
Last active November 12, 2024 19:08
Listen to your web pages
@mbenford
mbenford / spring-cleaning.js
Last active April 17, 2017 09:06
ngTagsInput spring cleaning script
const path = require('path');
const GitHubApi = require('github');
const jsonfile = require('jsonfile');
const moment = require('moment');
const async = require('async');
const config = require('./config.json');
const github = new GitHubApi({ protocol: 'https' });
github.authenticate({ type: 'oauth', token: config.token });
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@nikgraf
nikgraf / reactive-2016.md
Last active August 5, 2021 15:31
Proposal for lightning talk at Reactive Conf 2016

Rich text editing with DraftJS Plugins

Earlier this year Facebook open sourced its React based rich text editing framework Draft.js. At Facebook it powers status updates, comments & notes. Others used it to build editors matching Medium’s experience.

Together with a whole team of open source contributors I built a plugin architecture on top of Draft.js. In this talk I walk you through the existing plugins and show how you can build your own feature-rich text editor for the web with only a handful lines of code. 🤓

Draft JS Plugins Logo

@Rich-Harris
Rich-Harris / service-workers.md
Last active November 5, 2024 06:39
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

package com.wizbii.wizbiiandroid.services
import rx.Observable
import rx.subjects.PublishSubject
/**
* POC of a reactive data store.
*/
abstract class ReactiveStore<T> {
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};
@neutraltone
neutraltone / gulpfile.js
Last active January 25, 2018 03:22
A gulp task for creating SVG sprites, loading them into your template with AJAX and styling them with CSS
/**
* Gulp Packages
* =============
* Import our gulp packages.
*/
import gulp from 'gulp';
import svgmin from 'gulp-svgmin';
import svgstore from 'gulp-svgstore';
import cheerio from 'gulp-cheerio';
@bcoe
bcoe / npm-top.md
Last active November 6, 2024 03:34
npm-top.md

npm Users By Downloads (git.io/npm-top)


npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.

Metrics are calculated using top-npm-users.

# User Downloads
@jlongster
jlongster / immutable-libraries.md
Last active November 7, 2024 13:11
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing