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
set cursorline | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |
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
#!/usr/bin/env bash | |
# | |
# oh... double img... use https://github.com/nagadomi/waifu2x | |
# author: FATESAIKOU 2017/09/20 | |
# $1 = source file | |
# $2 = noise level(from 0 to 3) | |
IFS=$'\n' | |
waifu2x_home=***Your path to waifu2x home*** | |
src=$(readlink -f $1) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/mman.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#define MAX_CHILD 4096 |
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
#include <stdio.h> | |
int main() { | |
int MAX_LEN = 1024; | |
char buf[MAX_LEN]; | |
printf("<Start Reading>\n"); | |
while (fgets(buf, MAX_LEN - 1, stdin) != NULL) { | |
printf("%s", buf); | |
} |
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
import requests | |
import urllib | |
import json | |
from bs4 import BeautifulSoup as Soup | |
def doRequest(url): | |
return requests.get(url) | |
def searchComic(pattern): |
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
import requests | |
import urllib | |
import json | |
import re | |
from bs4 import BeautifulSoup as Soup | |
def doRequest(url): | |
return requests.get(url) |
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
from selenium import webdriver | |
# 開啟 chrome 瀏覽器 | |
driver = webdriver.Chrome() | |
# 前往 google 首頁 https://google.com.tw | |
driver.get("https://google.com.tw") | |
# 截圖並儲存為 google_homepage.png | |
driver.save_screenshot("google_homepage.png") |
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
#!/usr/bin/env bash | |
sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4 | |
sudo apt-get update && sudo apt-get install chromium-browser chromedriver | |
# APT 上找不到就得去 chromedriver 官網找到正確的版本安裝。 | |
# 通常版本號會與 chromium-browser --product-version 相同, | |
# 但也有可能唯獨最後面的小版本號不同(依然能使用),所以請 | |
# 人工確認 XXXXXX 當中的版號。 | |
# wget https://chromedriver.storage.googleapis.com/XXXXXX/chromedriver_linux64.zip |
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
FROM ubuntu:18.04 | |
# 安裝必要套件跟瀏覽器 | |
RUN apt-get update && \ | |
apt-get install -y apt-utils ssh && \ | |
apt-get install -y python3 python3-pip && \ | |
apt-get install -y chromium-browser udev chromium-chromedriver | |
RUN pip3 install selenium |
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
from selenium import webdriver | |
chrome_options = webdriver.ChromeOptions() | |
chrome_options.add_argument('--headless') | |
chrome_options.add_argument('--no-sandbox') | |
driver = webdriver.Chrome(options=chrome_options) | |
driver.get("https://google.com.tw") | |
driver.save_screenshot("google_homepage.png") | |
driver.close() |
OlderNewer