This file contains 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 p1 = (val) => new Promise((resolve, reject) => { | |
console.log('sent process 1') | |
setTimeout((val) => { | |
console.log('done1') | |
resolve(val) | |
}, 100, 'one'); | |
}); | |
var p2 = (val) => new Promise((resolve, reject) => { | |
console.log('sent process 2') |
This file contains 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
<!--[if IE]> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-shim.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-sham.min.js"></script> | |
<script src="https://wzrd.in/standalone/es7-shim@latest"></script> | |
<![endif]--> |
This file contains 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 shuffle(obj, key){ | |
if(['order', 'type', 'sector_1_id', 'sector_2_id', 'id'].includes(key)){ | |
return obj | |
} | |
if(['name'].includes(key)){ | |
return '明天無限美好' | |
} | |
if(['sub_funds', 'score_rating_intervals'].includes(key)){ | |
return [] | |
} |
This file contains 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
{"lastUpload":"2021-05-11T05:53:17.745Z","extensionVersion":"v3.4.3"} |
This file contains 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
// Add to application.js | |
$("body").bind("ajaxSend", function(elm, xhr, s){ | |
if (s.type == "POST") { | |
xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')); | |
} | |
}); | |
// OR |
This file contains 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
[ | |
["2017/12/18",26.3,27.8,29.8,24.1,0,0,16.893,11.978,0,0,0,0], | |
["2017/12/13",0,0,0,0,0,37.7,0,0,0,0,0,0], | |
["2017/12/11",26.1,27.6,29.6,23.9,0,0,16.693,11.778,0,0,0,0], | |
["2017/12/06",0,0,0,0,0,0,0,0,12.812,13.993,0,0], | |
["2017/12/04",0,0,0,24.1,0,0,16.893,11.978,0,0,0,0], | |
["2017/11/29",0,0,0,0,0,38.6,0,0,0,0,0,0], | |
["2017/11/27",26.2,27.7,29.7,24.0,0,0,16.793,11.878,0,0,0,0], | |
["2017/11/22",0,0,0,0,0,38.0,0,0,0,0,0,0], | |
["2017/11/20",26.1,27.6,29.6,23.9,0,0,16.693,11.778,0,0,0,0], |
This file contains 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 getScrollbarWidth(){ | |
var scrollDiv = document.createElement('div'); | |
scrollDiv.style.position = 'absolute'; | |
scrollDiv.style.top = '-9999px'; | |
scrollDiv.style.width = '50px'; | |
scrollDiv.style.height = '50px'; | |
scrollDiv.style.overflow= 'scroll'; | |
document.body.appendChild(scrollDiv); | |
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; | |
document.body.removeChild(scrollDiv); |
This file contains 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 ctx = document.getElementById('radar-chart').getContext('2d'); | |
var data = { | |
labels : ["January","February","March","April","May"], | |
datasets : [ | |
{ | |
fillColor : "rgba(220,220,220,0.5)", | |
strokeColor : "rgba(220,220,220,1)", | |
data : [65,59,90,81,56] | |
}, | |
{ |
This file contains 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
// https://www.facebook.com/pokes/?notif_t=poke | |
setInterval(function(){ | |
var cancel = document.querySelector('a[autofocus][action=cancel]'); | |
cancel && cancel.click(); | |
var poke = document.querySelector('a[ajaxify*="/pokes/inline/"]:not(.saving)'); | |
poke && poke.click(); | |
}, 1000); |
This file contains 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
/* | |
iFrameResponsive.js | |
by Lackneets Chang < [email protected] > | |
*/ | |
(function(){ | |
// Polyfill | |
// http://javascript.boxsheep.com/polyfills/Array-prototype-forEach/ | |
if (!Array.prototype.forEach) { | |
Array.prototype.forEach = function (fn, arg) { |
NewerOlder