Skip to content

Instantly share code, notes, and snippets.

View MrOrz's full-sized avatar
💤
Sleepy everyday

Johnson Liang MrOrz

💤
Sleepy everyday
View GitHub Profile
@MrOrz
MrOrz / README.md
Last active July 22, 2018 15:36
Cross-device BrowserSync with webpack demo
KB Article Number(s): 2704299
Language: All (Global)
Platform: i386
Location: (http://hotfixv4.microsoft.com/Windows%207/Windows%20Server2008%20R2%20SP1/sp2/Fix387976/7600/free/448094_intl_i386_zip.exe)
-----------------------------------------------------------
KB Article Number(s): 2704299
Language: All (Global)
Platform: x64
Location: (http://hotfixv4.microsoft.com/Windows%207/Windows%20Server2008%20R2%20SP1/sp2/Fix387976/7600/free/448095_intl_x64_zip.exe)
@MrOrz
MrOrz / inviteyoself-google-doc.gs
Last active August 29, 2015 14:25
This script adds a trigger to a Google Form to automatically setup submitted email to become an editor of a specific Google document.
/*
Inviteyoself for Google Doc
===========================
Google doc currently records who edited the file if the file is *not* set to `Anyone can edit'.
We cannot track the author of edits in documents that is set to `Anyone with the link can edit'.
This script adds a trigger to a Google Form to automatically setup submitted email to become an
editor of a specific Google document.
@MrOrz
MrOrz / README.md
Created November 21, 2015 04:06
mockStore would emit "done() called multiple times" error.

Steps to reproduce the bug

  1. Download the gist
  2. npm install
  3. npm test

This would lead you to the following output:

@MrOrz
MrOrz / graphql-exmaple.js
Created September 5, 2016 10:42
Minimal graphql example
const {
graphql,
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
} = require('graphql');
const schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
@MrOrz
MrOrz / moveDisplayNameToClass.js
Created May 26, 2017 10:27
This codemod script transforms all anonymous class expressions that extends `React`.* to named class declarations with their `displayName` static property.
/* Converts
export default class extends React.PureComponent {
static displayName = 'Calendar';
...
}
to this:
export default class Calendar extends React.PureComponent {
[
{
"key_as_string": "2016-12-05",
"key": 1480896000000,
"doc_count": 4,
"user_counts": {
"value": 1
}
},
{
@MrOrz
MrOrz / test_readability.js
Created March 19, 2018 16:42
Test web page summarization with Mozilla/Readability.js and puppeteer
const DOC_URL = process.argv[2];
const puppeteer = require('puppeteer');
const fs = require('fs');
const readabilityJsStr = fs.readFileSync('node_modules/readability/Readability.js', {encoding: 'utf-8'})
function executor() {
return new Readability({}, document).parse();
}
{
"type": "bubble",
"styles": {
"footer": {
"separator": true
}
},
"body": {
"type": "box",
"layout": "vertical",