Skip to content

Instantly share code, notes, and snippets.

@seaders
seaders / PersistentWebdriver.py
Created May 26, 2013 20:05 — forked from dnedbaylo/PersistentWebdriver.py
Valid for newest selenium and pep8 compliant.
from selenium import webdriver
from selenium.webdriver.remote.remote_connection import RemoteConnection
from selenium.webdriver.remote.errorhandler import ErrorHandler
class PersistentWebdriver (webdriver.Remote):
def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=None, browser_profile=None, proxy=None,
@seaders
seaders / gist:5668016
Last active December 17, 2015 20:29
Way to redirect a subdomain other than 'www' to a subdirectory with Apache. Apache mods enabled are 'headers', 'proxy', 'proxy_http' and 'rewrite'.
<VirtualHost *:80>
ServerName www.sixminute.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.sixminute\.com [NC]
RewriteCond %{HTTP_HOST} ^(.*?)\.?sixminute\.com$
RewriteRule ^/(.*) http://www.sixminute.com/%1/$1 [P]
ProxyPassReverse / http://www.sixminute.com/%1/
@seaders
seaders / gist:5905342
Last active December 19, 2015 05:39
Simple bit to allow you to have a background skin which has a constantly centered starling Image in it.
/*
Copyright 2013 Seadna Long. All Rights Reserved.
This program is free software. You can redistribute and/or modify it in
any way.
*/
package com.bluemanimposter.custom.starling.display
{
import starling.display.DisplayObjectContainer;
import starling.display.Image;
@seaders
seaders / RedirectTest
Created July 27, 2013 00:39
Little bit of code to show how Flash doesn't handle a redirect, which is incredibly common for interacting with Facebook images.
package
{
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
import flash.system.LoaderContext;
public class RedirectTest extends Sprite
import sh
class CommandWrapper(sh.Command):
'''
Here's the 'secret sauce' class, where we can wrap whatever we want for
python usage.
'''
def __init__(self, baseObject):
from . import app, db
def sendEmail(email_subject, email_from, email_to, email_reply_to, email_msg):
try:
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from boto.ses.connection import SESConnection
m = MIMEMultipart()
@seaders
seaders / resigner.py
Created June 30, 2014 13:22
Python ipa resigner script
import argparse
import sys
import os
import shutil
import re
import shlex
import subprocess
import plistlib
from functools import wraps
01-26 12:21:55.815 966-966/com.sixminute.freeracing D/GPLogin﹕ onActivityResult with requestCode = 9001, responseCode=-1, intent=null
01-26 12:21:55.866 966-966/com.sixminute.freeracing I/Unity﹕ onResume
01-26 12:21:55.870 966-966/com.sixminute.freeracing I/Unity﹕ windowFocusChanged: true
01-26 12:21:55.916 966-1003/com.sixminute.freeracing D/Unity﹕ Sensor : Accelerometer ( 1) ; 0.000595 / 0.00s ; MPU6515 Accelerometer / InvenSense
01-26 12:21:56.101 966-966/com.sixminute.freeracing D/GPLogin﹕ onConnected() called. Sign in successful!
01-26 12:21:56.113 966-1229/com.sixminute.freeracing D/GPLogin﹕ Getting GP accessToken with com.prime31.UnityPlayerNativeActivity@187789a4, xxxxxxxxx@gmail.com, audience:server:client_id:40xxxxx17-55xxxxxxxx4ji.apps.googleusercontent.com
01-26 12:21:56.167 966-966/com.sixminute.freeracing I/GPLogin﹕ Access token retrieved:xxxxxxxxx.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwic3ViIjoiMTA3OTkzMzI4MTQxNDc1ODE2MzM5IiwiYXpwIjoiNDAxODIxODQ1MDE3LWtmb
public class Program
{
static void Main(string[] args)
{
Pet rex;
rex = Something.MakeSomething<Pet>();
BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
using UnityEditor;
using System;
using System.Collections.Generic;
public class GameBuilder
{
static void Android()
{
List<EditorBuildSettingsScene> scenes = new List<EditorBuildSettingsScene>(EditorBuildSettings.scenes);
List<string> enabledScenes = new List<string>();