Skip to content

Instantly share code, notes, and snippets.

View smilecc's full-sized avatar
🎯
Focusing

SaltedFish smilecc

🎯
Focusing
  • Shanghai, China
  • 16:51 (UTC +08:00)
View GitHub Profile
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def open_tab(_driver, url):
_driver.execute_script("window.open('{}', '_blank');".format(url))
_driver.switch_to.window(_driver.window_handles[1])
@smilecc
smilecc / g-core-img-viewer.js
Last active May 25, 2018 04:49
Tempermonkey
// ==UserScript==
// @name 机核时间轴图片查看
// @namespace https://gist.github.com/smilecc/32bda108a55876b685356e9a48ea48aa#file-g-core-img-viewer-js
// @version 0.1
// @description 帮助你看到机核电台时间轴中的图片的原图
// @author Can
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
// @require https://cdn.jsdelivr.net/npm/bigpicture@1.2.3/dist/BigPicture.min.js
// @match https://www.g-cores.com/radios/*
@smilecc
smilecc / Redirect2html.js
Last active December 11, 2017 09:32
Redirect to .html
var extPos = window.location.href.lastIndexOf('.html');
if (extPos === -1 || extPos !== window.location.href.length - 5) {
window.location.href = window.location.href + '.html'
}