Skip to content

Instantly share code, notes, and snippets.

@mlzboy
mlzboy / qiniu_sslcert.py
Created January 18, 2023 13:33 — forked from lewangdev/qiniu_sslcert.py
qiniu_sslcert
#!/usr/bin/env python
## Dependencies:
#
# pip install qiniu
#
## Tips for Deploy certs to Qiniu:
#
# export DOMAIN=lewangdev.com
# export QINIU_DOMAIN=images.${DOMAIN},staticfiles.${DOMAIN}
@mlzboy
mlzboy / manifest.json
Created March 29, 2020 14:54 — forked from IzumiSy/manifest.json
Chrome.storage.sync example
{
"name": "SyncExtension",
"version": "0.1",
"manifest_version": 2,
"description": "Storage Sync Extension",
"permissions": [ "storage" ],
"browser_action": {
aaaa
import time,urllib2
from selenium import webdriver
def download(driver, target_path):
"""Download the currently displayed page to target_path."""
def execute(script, args):
driver.execute('executePhantomScript',
{'script': script, 'args': args})
# hack while the python interface lags
var result = [];
function mselect(i)
{
var str_i = "";
if (i < 9)
{
str_i = "0"+ (i+1).toString();
}
else
{
// ==UserScript==
// @name New Script
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant none
// @grant GM_setValue
// @grant GM.getValue
// ==/UserScript==
var i = 1;
var num = 2;
import time,urllib2
from selenium import webdriver
_init_js="""
(function (){
if (window.__e)
{ return;
}
var e=document.createElement('div');
e.setAttribute("id","__s_msg");
e.style.display="none";
@mlzboy
mlzboy / Selenium.Python.InjectJS.py
Created September 16, 2018 20:14 — forked from anhldbk/Selenium.Python.InjectJS.py
Inject jQuery into Selenium Driver
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://www.facebook.com/')
with open('jquery-1.9.1.min.js', 'r') as jquery_js:
jquery = jquery_js.read() #read the jquery from a file
driver.execute_script(jquery) #active the jquery lib
driver.execute_script("$('#email').text('anhld')")
@mlzboy
mlzboy / graphviz.html
Created August 10, 2018 07:23 — forked from afomi/graphviz.html
Graphviz Example
<script type="text/vnd.graphviz" id="graphviz">
digraph G {
"browser" ->
"http_request" ->
"server" ->
"routes" ->
"controller" ->
"model" -> "controller"
"controller" -> "response"
"response" -> "view" -> "html"
@mlzboy
mlzboy / config.json
Created April 30, 2018 01:06 — forked from wd/config.json
基于 3.8.6 以上 ss 版本的方案
{
"log": {
"loglevel": "none"
},
"inbound": {
"port": 23456,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true