Skip to content

Instantly share code, notes, and snippets.

View LiuJi-Jim's full-sized avatar
🏠
Working from home

Liu Ji LiuJi-Jim

🏠
Working from home
View GitHub Profile
@LiuJi-Jim
LiuJi-Jim / eval.js
Created June 27, 2018 03:37
eval module with local variables
const CLIEngine = require("eslint").CLIEngine;
function getIdentifiers(code) {
if (!code) {
return [];
}
var cli = new CLIEngine({
envs: ['browser', 'node'],
useEslintrc: false,
@LiuJi-Jim
LiuJi-Jim / .bashrc
Created March 7, 2018 03:25
my terminal profile
# coding PATH
CODING_DIR=$HOME/coding
export PATH=$CODING_DIR/app/bin:$PATH
export PATH=$CODING_DIR/tools/bin:$PATH
# PS1
export PS1="[\u@\H:\[\e[0;34m\]\W\[\e[0;0m\]]\$ "
# git
source $CODING_DIR/tools/git-completion.bash
@LiuJi-Jim
LiuJi-Jim / zhihu-51140536.txt
Created September 30, 2016 00:51
zhihu-51140536
===================== line 0 ======================
0 Ajpmnxjmz viy nzqzi tzvmn vbj, jpm avoczmn wmjpbco ajmoc pkji ocdn
1 Bkqnoykna wjz oaraj uawno wck, kqn bwpdano xnkqcdp bknpd qlkj pdeo
2 Clropzlob xka pbsbk vbxop xdl, lro cxqebop yolrdeq cloqe rmlk qefp
3 Dmspqampc ylb qctcl wcypq yem, msp dyrfcpq zpmsefr dmprf snml rfgq
4 Entqrbnqd zmc rdudm xdzqr zfn, ntq ezsgdqr aqntfgs enqsg tonm sghr
5 Fourscore and seven years ago, our fathers brought forth upon this
6 Gpvstdpsf boe tfwfo zfbst bhp, pvs gbuifst cspvhiu gpsui vqpo uijt
7 Hqwtueqtg cpf ugxgp agctu ciq, qwt hcvjgtu dtqwijv hqtvj wrqp vjku
8 Irxuvfruh dqg vhyhq bhduv djr, rxu idwkhuv eurxjkw iruwk xsrq wklv
@LiuJi-Jim
LiuJi-Jim / id-card.js
Created June 14, 2016 04:26
id-num gen
var factors = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
var tails = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']
var provinceMap = {
11: '北京',
12: '天津',
13: '河北',
14: '山西',
15: '内蒙古',
21: '辽宁',
22: '吉林',
@LiuJi-Jim
LiuJi-Jim / staticSubTree.html
Last active May 12, 2016 03:28
vue staticSubTree
<div id="counter-app">
<h1>Count: {{count}}</h1>
<h2>I will never change</h2> <!-- 这个节点是“纯静态子树”,不必更新,事实上它的确中了全等逻辑 -->
<button @click="count++">+1</button> <!-- 这个节点(看起来)也是“纯静态子树”,但它没有中全等逻辑 -->
<!-- 不过可以理解,因为它有一个event绑定(但看起来不会影响它的“纯静态”性质) -->
<!-- 另外,因为HTML标签之间的换行和空格带来的一些空文本节点也纷纷没有中全等逻辑 -->
</div>
<script>
var vm = new Vue({
@LiuJi-Jim
LiuJi-Jim / parseUrl.js
Created January 20, 2016 08:24
URL parsing with HTMLAnchorElement
const RE_URL_ARRAY = /\[(.*?)\]$/
export function parseQuery(search) {
search = search.replace(/^\?/, '')
let query = {}
search.split('&').forEach(pair => {
let kv = pair.split('=')
let key = kv[0]
let value = kv[1]
if (!value) value = ''
value = decodeURIComponent(value)
@LiuJi-Jim
LiuJi-Jim / douyutv.css
Last active November 10, 2016 12:18
斗鱼界面精简
/**
斗鱼界面精简
douyutv.com
douyu.com
*/
#chat-top-ad,
#dy_bottom_shadow,
.chat-right-ad,
.chat_top_pic,
@LiuJi-Jim
LiuJi-Jim / getCurrentScript.js
Created November 20, 2015 07:58
getCurrentScript
var getCurrentScript = (function () {
var supportsScriptReadyState = ('readyState' in document.createElement('script'))
var isNotOpera = !window.opera || window.opera.toString() !== "[object Opera]"
function getCurrentScript() {
if (document.currentScript) {
// Chrome, OSX Safari, Firefox, Edge
return document.currentScript.src
}
@LiuJi-Jim
LiuJi-Jim / tieba-ad.css
Last active January 25, 2024 04:10
百度贴吧去广告
/*
用于Stylish
网址前缀:http://tieba.baidu.com/
*/
/* 列表页的 */
#thread_list>li:not(.j_thread_list)>.t_con,
#thread_list>li:not(.j_thread_list)>.iframe_wrapper,
#thread_list>li:not(.j_thread_list)>[id^=cpro],
#com_u9_head,
@LiuJi-Jim
LiuJi-Jim / nga-stylish.css
Created August 14, 2015 08:26
NGA Stylish
[id^="postads"],
[id^="bbs_ds"],
.adsc,
.adsh,
#gwd_browser_download
{
display: none !important;
}