This file contains 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 python | |
import os | |
import argparse | |
import logging | |
import datetime | |
import urlparse | |
import subprocess | |
logging.basicConfig(level=logging.INFO) |
This file contains 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
/** | |
* bounceserver.js | |
* License: MIT (http://www.opensource.org/licenses/mit-license.php/) | |
* Author: Jason Feinstein (jason.feinstein@gmail.com) | |
* | |
* Instructions: | |
* 1. Install node.js: http://nodejs.org | |
* 2. run this file, listing the bounce addresses like so: | |
* node bounceserver.js http://mybounceaddress:1111/ http://google.com | |
* 3. Start sending requests to the server. They will be bounced properly! |
This file contains 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 java.util.regex.Pattern | |
class VersionInfo { | |
private static Pattern VERSION_NAME_PATTERN = Pattern.compile("versionName='([0-9]+(\\.[0-9]+)+)'", Pattern.MULTILINE) | |
private static Pattern VERSION_CODE_PATTERN = Pattern.compile("versionCode='([0-9]+)'", Pattern.MULTILINE) | |
public File apkFile; | |
public String versionName; | |
public int versionCode; | |
public VersionInfo(File apkFile, String aaptOutput) { |
This file contains 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 base64 | |
import uuid | |
import hashlib | |
def hash_password(password, salt=None): | |
if salt is None: | |
salt = uuid.uuid4().hex | |
hashed_password = hashlib.sha512(password + salt).hexdigest() |
This file contains 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
define(function(){ | |
var instance = null; | |
function MySingleton(){ | |
if(instance !== null){ | |
throw new Error("Cannot instantiate more than one MySingleton, use MySingleton.getInstance()"); | |
} | |
this.initialize(); | |
} |
This file contains 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
class VersionInfo { | |
public static Pattern VERSION_NAME_PATTERN = Pattern.compile("versionName='([0-9]+(\\.[0-9]+)+)'", Pattern.MULTILINE) | |
public static Pattern VERSION_CODE_PATTERN = Pattern.compile("versionCode='([0-9]+)'", Pattern.MULTILINE) | |
public File apkFile; | |
public String versionName; | |
public int versionCode; | |
public VersionInfo(File apkFile, String versionName, int versionCode) { | |
this.apkFile = apkFile; | |
this.versionName = versionName |
This file contains 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
// Triggers the 'onresize' event for the window manually. | |
if(document.createEventObject){ | |
window.fireEvent('onresize', document.createEventObject()); | |
} else { | |
var evt = document.createEvent("HTMLEvents"); | |
evt.initEvent('resize', true, true); | |
window.dispatchEvent(evt); | |
} |
This file contains 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
function debounce(fn, debounceDuration){ | |
// summary: | |
// Returns a debounced function that will make sure the given | |
// function is not triggered too much. | |
// fn: Function | |
// Function to debounce. | |
// debounceDuration: Number | |
// OPTIONAL. The amount of time in milliseconds for which we | |
// will debounce the function. (defaults to 100ms) |
This file contains 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
def getVersionInfo = { File apkFile -> | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine getAaptPath(), "dump", "badging", apkFile.absoluteFile | |
standardOutput = stdout | |
} | |
return new VersionInfo(apkFile, stdout.toString()) | |
} |
This file contains 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 java.util.regex.Pattern | |
class VersionInfo { | |
private static Pattern VERSION_NAME_PATTERN = Pattern.compile("versionName='([0-9]+(\\.[0-9]+)+)'", Pattern.MULTILINE) | |
private static Pattern VERSION_CODE_PATTERN = Pattern.compile("versionCode='([0-9]+)'", Pattern.MULTILINE) | |
public File apkFile; | |
public String versionName; | |
public int versionCode; | |
public VersionInfo(File apkFile, String aaptOutput) { |
NewerOlder