Skip to content

Instantly share code, notes, and snippets.

View SixPenny's full-sized avatar

Dylan SixPenny

View GitHub Profile
#! /usr/local/bin/python3
# install on Mac
# sudo pip3 install pyobjc-framework-Quartz
# sudo pip3 install pyobjc-core
# sudo pip3 install pyobjc
# sudo pip3 install pyautogui
# When doing some background work, Mac will auto sleep after several minutes
# running this will prevent Mac to sleep
# Install web driver if you're on windowns or linux and change webdriver
# Run this directly if you're on mac
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
print("loading Safari")
broswer=webdriver.Safari()
print("loaidng 2048")
broswer.get("https://play2048.co/")
@SixPenny
SixPenny / gist:00ff40926bfb54dd673da03049100e76
Created October 12, 2017 07:19
cglib保存生成的代理类
public static void saveGeneratedCGlibProxyFiles() throws Exception {
Field field = System.class.getDeclaredField("props");
field.setAccessible(true);
Properties props = (Properties) field.get(null);
System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY, "D:\\tmp\\cglib");//dir为保存文件路径
props.put("net.sf.cglib.core.DebuggingClassWriter.traceEnabled", "true");
}