View no-proxy.bat
set http-proxy= | |
set https-proxy= | |
set http_proxy= | |
set https_proxy= | |
start cmd |
View kill-android-process.py
import subprocess | |
import sys | |
pslist = subprocess.check_output("adb shell ps " + sys.argv[1]).decode("utf-8").split() | |
if len(pslist) > 8: | |
pid = pslist[9] | |
print("killing " + pid) | |
subprocess.check_call("adb shell kill " + pid) |
View reinstall-apk.py
import subprocess | |
import sys | |
import re | |
apkpath = sys.argv[1] | |
print('checking packagename') | |
head = subprocess.check_output('aapt d badging "' + apkpath + '"').decode("utf-8").split("\n")[0] | |
packagename = re.match(r'^package: name=\'([A-Za-z0-9\.]+)\'', head).group(1) | |
print('uninstalling ' + packagename) | |
subprocess.check_call("adb uninstall " + packagename) |
View clojure-exponent.clj
(defn exp | |
"exponent of x^n (int n only), with tail recursion and O(logn)" | |
[x n] | |
(if (< n 0) | |
(/ 1 (exp x (- n))) | |
(loop [acc 1 | |
base x | |
pow n] | |
(if (= pow 0) | |
acc |
View infinite-recursive-eval.js
var recursive = "var iterationNum=ITERATION_NUM; console.log('iteration number %s', iterationNum); var recursive = \"REPLACE\"; eval(recursive.replace('REPLACE', recursive.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/'/g, '\\\\\\'')).replace('ITERATION_NUM', iterationNum + 1))"; | |
eval(recursive.replace('REPLACE', recursive.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/'/g, '\\\'')).replace('ITERATION_NUM', 0)); |
View dex.py
import zipfile | |
import sys | |
def methods_in_dex(dex_bytes): | |
return int.from_bytes(dex_bytes[88:92], byteorder='little', signed=False) | |
def methods_in_apk(apkfile, dexfile='classes.dex'): | |
with zipfile.ZipFile(apkfile, 'r') as apkzip: | |
dex_bytes = apkzip.read(dexfile) | |
return methods_in_dex(dex_bytes) |
View browser-policy.coffee
laxBrowserPolicy = -> | |
BrowserPolicy.content.allowOriginForAll "localhost:*" | |
BrowserPolicy.content.allowConnectOrigin "ws://localhost:*" | |
BrowserPolicy.content.allowConnectOrigin "http://localhost:*" | |
Meteor.startup -> | |
BrowserPolicy.content.disallowInlineScripts() | |
BrowserPolicy.content.disallowInlineStyles() | |
BrowserPolicy.content.disallowEval() |
View _mutation_observer_helper.js
observeMutationsHelper = function(targetSelector, done, callback) { | |
var target = document.querySelector(targetSelector); | |
var observer = new MutationObserver(function(mutations) { | |
callback(mutations); | |
observer.disconnect(); | |
done(); | |
}); | |
var config = { | |
attributes: true, | |
childList: true, |
View documentSpreader.html
<template name="fieldSpreader"> | |
{{#if isArray}} | |
{{> arraySpreader}} | |
{{else}} | |
{{#if isObject}} | |
{{> objectSpreader}} | |
{{else}} | |
{{!-- This is just a value type --}} | |
{{ this}} | |
{{/if}} |
NewerOlder