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
SCSS 1 hr 24 mins ████████████████████▌ 98.2% | |
JavaScript 1 min ▎░░░░░░░░░░░░░░░░░░░░ 1.5% | |
CSS 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.3% |
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
|
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 debounce = (f, time) => { | |
let debounced | |
return function (...args) { | |
const actor = () => f.apply(this, args) | |
clearTimeout(debounced) | |
debounced = setTimeout(actor, time) | |
} | |
} | |
const throttle = (f, time) => { |
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 decimalism = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'] | |
const scalar = ['', '十', '百', '千'] | |
const modular = 10000 | |
const modualrScalar = ['', '万', '亿', '万'] | |
function _123To壹贰叁 (num) { | |
if (isNaN(num)) return 'NaN' | |
if (num === 0) return '零' | |
if (num >= 1000000000000) return 'NaN' // 会计用兆而不是万亿,懒得转换了 |
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
# Show 20 biggest directories with 'K M G' | |
du | \ | |
sort -r -n | \ | |
awk '{split("K M G",v); s=1; while($1>1024){$1/=1024; s++} print int($1)" "v[s]"\t"$2}' | \ | |
head -n 20 |
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
class DotDict(dict): | |
def __init__(self, value): | |
self.__dict__['__value'] = value | |
dict.__init__(self, value) | |
def __getattr__(self, key): | |
if key == '__value' or key == '_DotDict__value': | |
return self.__dict__['__value'] |
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
/*! | |
* | |
* ap/v1.13.0 | |
* Wed Dec 12 2018 15:41:56 GMT+0800 (GMT+08:00) | |
* | |
*/ | |
var global = self | |
, __appxStartTime = (global = self, | |
Date.now()) | |
, AFAppX = function(e) { |
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 DI = function (dependency) { | |
this.dependency = dependency; | |
}; | |
function readParams(func) { | |
const fs = func.toString() | |
const paramsMatch = fs.match(/^function.*\((.*?)\)/) || fs.match(/(.*?)\s*\=\>/) | |
if (!paramsMatch) throw '' | |
const paramsStr = paramsMatch[1].replace(/[\(\)]/g, '') |
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
#partial-discussion-header > div.gh-header-shadow.box-shadow { | |
height: 45px; | |
} | |
#partial-discussion-header > div.js-sticky.js-sticky-offset-scroll.top-0.gh-header-sticky.is-stuck > div > div { | |
margin-top: 2px !important; | |
} | |
.gh-header .gh-header-sticky.is-stuck+.gh-header-shadow { | |
z-index: 18; |
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
module Main | |
import System | |
readNumber : IO (Maybe Nat) | |
readNumber = do | |
input <- getLine | |
if all isDigit $ unpack input | |
then pure (Just $ cast input) |
NewerOlder