This file contains hidden or 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/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 |
This file contains hidden or 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
| # 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/") |
This file contains hidden or 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
| 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"); | |
| } |