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 a = (99.3 / 18.6) | 0; // 5 | |
var b = ~~(99.3 / 18.6); // 5 | |
window === true // false | |
!!window === true // true |
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
<div id="sample"></div> | |
<script type="text/javascript"> | |
console.log(sample); | |
</script> |
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 parseURL(url) { | |
var a = document.createElement('a'); | |
a.href = url; | |
return { | |
source: url, | |
protocol: a.protocol.replace(':',''), | |
host: a.hostname, | |
port: a.port, | |
query: a.search, | |
params: (function(){ |
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 _log = console.log; | |
console.log = function() { | |
_log.call(console, '%c' + [].slice.call(arguments).join(' '), 'color:transparent;text-shadow:0 0 2px rgba(0,0,0,.5);'); | |
}; |
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 generateRandomAlphaNum(len) { | |
var rdmString = ""; | |
for (; rdmString.length < len; rdmString += Math.random().toString(36).substr(2)); | |
return rdmString.substr(0, len); | |
} |
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
// http://40era.com/2641/ | |
var calTW = function(salary, mo) { | |
var range = { | |
r1: { | |
off: 0, | |
tax: 3, | |
range: 1500 | |
}, | |
r2: { | |
off: 105, |
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
// | |
// LoadingView.h | |
// | |
// | |
// Created by Isken on 3/16/11. | |
// Copyright 2011 Isken. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
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
#!/bin/sh | |
echo "Deploy beign" | |
# 設定 nodejs 環境(如果是用 nvm 管理 nodejs 才需要) | |
. "$HOME/.nvm/nvm.sh" | |
# 設定 project 路徑 | |
export PROJECT_DIR=$HOME/PROJECT |
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
#!/bin/bash | |
sudo apt-get remove phantomjs | |
sudo unlink /usr/local/bin/phantomjs | |
sudo unlink /usr/local/share/phantomjs | |
sudo unlink /usr/bin/phantomjs | |
cd /usr/local/share |
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
javascript:!function(d,script){script=d.createElement("script"),script.type="text/javascript",script.async=!0,script.onload=function(){return TogetherJS(this),!1},script.src="https://togetherjs.com/togetherjs-min.js",d.getElementsByTagName("head")[0].appendChild(script)}(document); |