Skip to content

Instantly share code, notes, and snippets.

View lackneets's full-sized avatar
🤗
Sorry I am super busy. I may respond in weeks or months

Lackneets Chang (小耀博士) lackneets

🤗
Sorry I am super busy. I may respond in weeks or months
  • TAROBO Investment Advisors Ltd.
  • Taipei, Taiwan
View GitHub Profile
@lackneets
lackneets / gasoline.json
Created December 20, 2017 05:22
2017/12/20 汽油歷史價格
[
["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],
// 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
@lackneets
lackneets / cloudSettings
Last active May 11, 2021 05:53
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-05-11T05:53:17.745Z","extensionVersion":"v3.4.3"}
@lackneets
lackneets / shuffle-2.js
Last active May 21, 2019 08:01
混淆數值
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 []
}
<!--[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]-->
@lackneets
lackneets / tasks.js
Created February 5, 2021 07:03
Promise One by One
(() => {
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')