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
// if you have a object like this | |
// { | |
// tpl1: `Hello {name}, welcome to {location}`, | |
// tpl2: `yo {bro}`, | |
// } | |
// and you wanna get a type like this | |
// { | |
// name: string, | |
// location: string, | |
// bro: string |
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
<style> | |
header, footer, main { | |
display: block; | |
} | |
header { | |
position: fixed; | |
height: 50px; | |
left: 0; | |
right: 0; |
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
/** | |
* 1 打开 https://m.weibo.cn/beta 登陆你被炸的账号 | |
* 2 打开浏览器控制台 | |
**/ | |
function delay (time) { | |
return new Promise(r => { | |
setTimeout(() => r(), time || 1000); // 延时 1s,可适当增加延长时间 | |
}); | |
} |
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 allSets (arr) { | |
const target = Math.pow(2, arr.length) - 1; | |
const all = []; | |
for (let i = 1; i <= target; i++) { | |
all.push(Array.from({length: arr.length}, (v, index) => i & (1 << index) ? arr[index] : null).filter(v => arr.indexOf(v) > -1)); | |
} | |
console.log(all); | |
} | |
function allSetsRec (arr, index, set, all) { |
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
<?php | |
// error_reporting(E_ALL); | |
$code = $_GET['code']; | |
$token = $_COOKIE['access_token']; | |
if (!empty($code)) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,"https://github.com/login/oauth/access_token"); | |
curl_setopt($ch, CURLOPT_POST, 1); |
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
https://gist.github.com/gongpeione.atom |
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 eventFire(el, etype){ | |
if (el.fireEvent) { | |
el.fireEvent('on' + etype); | |
} else { | |
var evObj = document.createEvent('Events'); | |
evObj.initEvent(etype, true, false); | |
el.dispatchEvent(evObj); | |
} | |
} |
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
html { | |
-moz-osx-font-smoothing: grayscale; | |
-webkit-font-smoothing: antialiased; | |
text-rendering: optimizeLegibility; | |
} |
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
pointer-events: none; | |
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='your_transparent.png', sizingMethod='scale'); | |
background: none !important; |
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
SELECT * | |
FROM | |
( | |
SELECT *, 'cdk_record_07' as tableName FROM cdk_record_07 | |
UNION ALL | |
SELECT *, 'cdk_record_01' as tableName FROM cdk_record_01 | |
) s |
NewerOlder