Skip to content

Instantly share code, notes, and snippets.

View chuanxd's full-sized avatar

Timmy Chang chuanxd

View GitHub Profile
if (/Android */.test(navigator.appVersion)) {
window.addEventListener('resize', () => {
if (document.activeElement.tagName === 'INPUT') {
window.setTimeout(() => {
document.activeElement.scrollIntoViewIfNeeded()
}, 0)
}
})
}
[{"name":"伍輪企業股份有限公司","lat":"24.9764601","lng":"121.2345903"},{"name":"安利日用品股份有限公司","lat":"25.1257367","lng":"121.5005259"},{"name":"陳氏強化玻璃股份有限公司","lat":"22.7039461","lng":"120.3433128"},{"name":"建哲有限公司","lat":"24.6806175","lng":"120.8741805"},{"name":"宏奇工業社","lat":"23.05935","lng":"120.216309"},{"name":"五福實業社","lat":"25.0713479","lng":"121.514263"},{"name":"順穎精密有限公司","lat":"24.1009999","lng":"120.519207"},{"name":"金炤工業有限公司","lat":"25.0492896","lng":"121.5933862"},{"name":"迦南通信工業股份有限公司","lat":"25.0478338","lng":"121.5841548"},{"name":"宏奇電腦用品有限公司","lat":"25.053857","lng":"121.587895"},{"name":"龍羽企業有限公司","lat":"25.0607706","lng":"121.613273"},{"name":"新豐塑膠有限公司","lat":"25.06109","lng":"121.61261"},{"name":"銓鴻鋼鋁業有限公司","lat":"25.063219","lng":"121.599767"},{"name":"名霖企業社","lat":"25.032142","lng":"121.416839"},{"name":"昇倫金屬有限公司","lat":"25.0496424","lng":"121.589797"},{"name":"樹樺電子股份有限公司","lat":"25.061364","lng":"121.602168"},{"name":"宜修企業有限公司","lat":"25.0535129","lng":"121.5862197"},{"name":"珩陞行生物科技股份有限公司","lat":"2
[{"name":"伍輪企業股份有限公司","lat":"24.9764601","lng":"121.2345903"},{"name":"安利日用品股份有限公司","lat":"25.1257367","lng":"121.5005259"},{"name":"陳氏強化玻璃股份有限公司","lat":"22.7039461","lng":"120.3433128"},{"name":"建哲有限公司","lat":"24.6806175","lng":"120.8741805"},{"name":"宏奇工業社","lat":"23.05935","lng":"120.216309"},{"name":"五福實業社","lat":"25.0713479","lng":"121.514263"},{"name":"順穎精密有限公司","lat":"24.1009999","lng":"120.519207"},{"name":"金炤工業有限公司","lat":"25.0492896","lng":"121.5933862"},{"name":"迦南通信工業股份有限公司","lat":"25.0478338","lng":"121.5841548"},{"name":"宏奇電腦用品有限公司","lat":"25.053857","lng":"121.587895"},{"name":"龍羽企業有限公司","lat":"25.0607706","lng":"121.613273"},{"name":"新豐塑膠有限公司","lat":"25.06109","lng":"121.61261"},{"name":"銓鴻鋼鋁業有限公司","lat":"25.063219","lng":"121.599767"},{"name":"名霖企業社","lat":"25.032142","lng":"121.416839"},{"name":"昇倫金屬有限公司","lat":"25.0496424","lng":"121.589797"},{"name":"樹樺電子股份有限公司","lat":"25.061364","lng":"121.602168"},{"name":"宜修企業有限公司","lat":"25.0535129","lng":"121.5862197"},{"name":"珩陞行生物科技股份有限公司","lat":"2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import styled from 'styled-components';
const isCurrent = (current, key) => current.group === key[0] && current.attr === key[1] ? true : false;
const hoverColor = '#9c9c9c';
const activeColor = '#00bbff';
const pressColor= '#6c6c6c';
export const BorderWrap = styled.div`
position: relative;
@chuanxd
chuanxd / javascript-promise-finally.js
Created March 24, 2017 09:17
實做一個 promise finally
// http://bluebirdjs.com/docs/api/finally.html
Promise.prototype.end = function(fn) {
return new Promise((resolve, reject)=>{
this.then((res)=>{
fn(false, res)
resolve()
})
.catch((er)=>{
fn(true, er)
const timezone = [
'GMT-11:00 - Pacific/Midway',
'GMT-11:00 - US/Samoa',
'GMT-10:00 - US/Hawaii',
'GMT-09:00 - US/Alaska',
'GMT-08:00 - US/Pacific',
'GMT-08:00 - America/Tijuana',
'GMT-07:00 - US/Arizona',
'GMT-07:00 - US/Mountain',
'GMT-07:00 - America/Chihuahua',
@chuanxd
chuanxd / vscode-window-keybindings.json
Last active March 9, 2017 09:18
Switch key cmd & ctrl
[
{ "key": "cmd+1", "command": "workbench.action.openEditorAtIndex1" },
{ "key": "cmd+2", "command": "workbench.action.openEditorAtIndex2" },
{ "key": "cmd+3", "command": "workbench.action.openEditorAtIndex3" },
{ "key": "cmd+4", "command": "workbench.action.openEditorAtIndex4" },
{ "key": "cmd+5", "command": "workbench.action.openEditorAtIndex5" },
{ "key": "cmd+6", "command": "workbench.action.openEditorAtIndex6" },
{ "key": "cmd+7", "command": "workbench.action.openEditorAtIndex7" },
{ "key": "cmd+8", "command": "workbench.action.openEditorAtIndex8" },
{ "key": "cmd+9", "command": "workbench.action.openEditorAtIndex9" },
@chuanxd
chuanxd / gist:60202f7342245f83d942533eb30ed7ab
Created June 1, 2016 10:49 — forked from ihower/gist:6132576
Git commit without commit
# First commit
echo "hello" | git hash-object -w --stdin
git update-index --add --cacheinfo 100644 ce013625030ba8dba906f756967f9e9ca394464a hello.txt
git write-tree
git commit-tree aaa96c -m "First commit"
git update-ref refs/heads/master 30b060d9a7b5e93c158642b2b6f64b2b758da40d
# Second commit