Skip to content

Instantly share code, notes, and snippets.

View benbai123's full-sized avatar

Ben benbai123

View GitHub Profile
// ==UserScript==
// @name twse
// @namespace twse
// @description twse
// @include http://mis.twse.com.tw/stock/fibest.jsp?stock=*
// @version 1
// @grant none
// ==/UserScript==
/**
這是搭配 twse 股票報價的 script
@benbai123
benbai123 / test.css
Created June 21, 2017 05:29
floatTest
.float {float: left; width: 40%; background-color: green; margin: 10px;}
.inline-one {height: 50px;}
.inline-two {height: 100px;}
@benbai123
benbai123 / 001_建立快速功能書籤.txt
Last active November 24, 2016 00:50
UrCosme 前端 Patch 使用教學
1. 連到任一網頁如 google.com
2. 點擊網址列旁的星星加入書籤
3. 將書籤連結改為以下之一
最初可用版本
javascript:$('head').append('<script src="https://cdn.rawgit.com/benbai123/HTML_CSS_Javascript_practice/ucpaging/tmp/uccustomize.js"></script>');
第二版
##
# from ubuntu 14.04 container first
# ref: https://docs.docker.com/engine/tutorials/dockerimages/
##
# pull ubuntu 14.04 and run it
sudo docker pull ubuntu:14.04
sudo docker run -t -i --expose 3306 --expose 3000 -p 3306:3306 -p 3000:3000 ubuntu:14.04 /bin/bash
# container up, run in container below
@benbai123
benbai123 / Use WinSCP to Get Files From Remote Ubuntu Daily.bat
Last active September 2, 2016 03:22
Use WinSCP to Get Files From Remote Ubuntu Daily
@echo off
SETLOCAL enabledelayedexpansion
SET scpbase=C:\Users\Bai\SCP\
SET scplatest=C:\Users\Bai\SCP\Latest
:: install WinSCP on Windows
:: install openssh server on Ubuntu
:: sudo apt-get install openssh-server
:: sudo ufw allow 22
:: 取當日
:loop
var focuspwTimer, blurpwTimer;
function resetPwTimer () {
clearTimeout(focuspwTimer);
clearTimeout(blurpwTimer);
}
function focusPw () {
resetPwTimer();
focuspwTimer = setTimeout(function () {
if (!$('#pwfocusbox')[0]) {
$('.cd-user-modal')
var _handleTradeWaitingQueue = [], // 處理的 queue
concurrentTradeLimit = 300, // 同時處理上限
concurrentTradeCount = 0; // 處理計數
function afterTradeHandle () {
// 計數小於上限 且 有未處理項目才處理
if (concurrentTradeCount < concurrentTradeLimit
&& _handleTradeWaitingQueue.length) {
concurrentTradeCount++;
handle(_handleTradeWaitingQueue.shift());
@benbai123
benbai123 / Install Docker on Ubuntu 14.04
Created August 25, 2016 11:32
Install Docker on Ubuntu 14.04
# Ref: https://docs.docker.com/engine/installation/linux/ubuntulinux/
# Update package information, ensure that APT works with the https method, and that CA certificates are installed.
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
# Add the new GPG key.
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# Open the /etc/apt/sources.list.d/docker.list file in your favorite editor.
##
# from ubuntu 14.04 container first
# ref: https://docs.docker.com/engine/tutorials/dockerimages/
##
# pull ubuntu 14.04 and run it
sudo docker pull ubuntu:14.04
sudo docker run -t -i --expose 3306 --expose 80 -p 3306:3306 -p 80:80 ubuntu:14.04 /bin/bash
@benbai123
benbai123 / 001_測試說明.txt
Last active October 19, 2016 13:08
給前公司 找產品心得功能的修改建議
gzip 測試使用線上 gzip 網站
可以直接估狗 gzip online 就找得到了
http://www.txtwizard.net/compression
sample JSON 為連到
https://www.urcosme.com/find-product/1
開啟 Chrome Developer Tools 的 console
執行以下 SampleJSON.js 內的 JavaScript *1
即會從當前頁面爬內容生成 JSON string