Skip to content

Instantly share code, notes, and snippets.

@dacer
dacer / surge_main.conf
Created October 27, 2015 03:06 — forked from jason5ng32/surge.conf
Surge Configs ( Both 2 files are needed )
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
// DNS OVERRIDE, REMOVE # IF YOU NEED
# dns-server = 223.6.6.6,223.5.5.5,114.114.114.114,114.114.115.115
[Rule]
def json2simpleHash(json_str, prefix = '')
result = {}
json = JSON.parse(json_str)
json.each do |key, value|
if(value.is_a?(Hash))
result.merge!(json2simpleHash(value.to_json, prefix+key+'_'))
else
result.merge!({"#{prefix}#{key}" => value})
end
end
#!/bin/bash
f=$(pwd)
mkdir drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi
# fake argv and argc in bash
argc=$#; argv[0]=$0 # argv[0] is a prog name
for foo in $( seq $argc )
do
@dacer
dacer / Amazon-Personal-Documents-Deleter.js
Last active December 24, 2015 11:19
It's a veryvery simple js for deleting various documents you send to kindle by email. Just open the https://www.amazon.com/gp/digital/fiona/manage#All And open chrome console, copy/paste the js code in it then click your enter key. It will auto delete the 15 items on the page.
for (var i=1;i<16;i++){
document.getElementById("actionSelect"+i).click();
document.getElementById("deleteLink_"+i).click();
document.getElementsByClassName("ap_custom_close")[0].click();
}