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
HI = window.HI || {} | |
HI.waitMS = async ms => new Promise(resolve => setTimeout(resolve, ms)) | |
HI.loadJS = (src, call) => { | |
var script = document.createElement('script') | |
script.src = src // + '?_t=' + Date.now() | |
script.onload = call | |
document.head.appendChild(script) | |
} |
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
My Awesome Sketch | |
First State | |
some event -> Second State | |
Second State |
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 merge_products_with_same_id_and_same_grouped_addons(products) { | |
var grouped_products_map_by_same_id_and_same_grouped_addons = {} | |
var generate_hash_key_for_grouped_addons = function(addons) { | |
if (!addons || !addons.sort) return '' | |
addons.sort(function(addon1, addon2){ return addon1.id > addon2.id ? 1 : -1}) | |
return JSON.stringify(addons) | |
} | |
var generate_hash_key_for_product = function(product) { |
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 util = { | |
i: 0, | |
uuid: function() {return this.i++}, | |
copyObj: function(obj) { | |
var result = Array.isArray(obj) ? [] : {}; | |
for (var key in obj) result[key] = obj[key]; | |
return result; | |
} | |
}; |
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
/** | |
* Created by Rango Yuan on 2017/11/27. | |
* crossTabsMemoryStorage is for fixing sessionStorage | |
* https://truongtx.me/2014/06/16/cross-tab-communication-using-html5-dom-storage | |
*/ | |
define([], function() { | |
if (window.crossTabsMemoryStorage) return window.crossTabsMemoryStorage; | |
return window.crossTabsMemoryStorage = (function() { |
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
const walk = require('walk') | |
const fs = require('fs') | |
const path = require('path') | |
const cheerio = require('cheerio') | |
const targetDir = "../wikicraft/www/wiki/html"; | |
const options = { | |
followLinks: false, | |
filters: ["articles", "templates", "tutorial"] | |
}; | |
const emptyCall = () => {}; |
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
const fs = require('fs'); | |
const Jimp = require('jimp'); | |
const electron = require('electron'); | |
const html2canvas = require('html2canvas'); | |
const remote = electron.remote; | |
const nativeImage = electron.nativeImage | |
const Menu = remote.Menu; | |
const MenuItem = remote.MenuItem; |
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
#!/usr/bin/env node | |
var fs = require('fs'); | |
var $ = require('cheerio'); | |
var sh = require('child_process').execSync; | |
var indexs = []; | |
for(let i=1; i<=61; i++) indexs.push(i); | |
var combo_body = indexs.map(i => { |
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 download(url) { | |
var a = document.createElement('a'); | |
a.setAttribute('href', url); | |
a.setAttribute('download', ''); | |
a.click(); | |
} | |
var indexs = []; | |
for(let i=1; i<=61; i++) indexs.push(i); |
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 download(url) { | |
var a = document.createElement('a'); | |
a.setAttribute('href', url); | |
a.setAttribute('download', ''); | |
a.click(); | |
} |