type readerFunc func(p []byte) (n int, err error)
func (rf readerFunc) Read(p []byte) (n int, err error) { return rf(p) }
func Copy(ctx context.Context, dst io.Writer, src io.Reader) error {
_, err := io.Copy(dst, readerFunc(func(p []byte) (int, error) {
select {
case <-ctx.Done():
return 0, ctx.Err()
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
| package appiumworkaround; | |
| import io.appium.java_client.windows.WindowsDriver; | |
| import java.io.IOException; | |
| import java.net.URI; | |
| import java.net.http.HttpClient; | |
| import java.net.http.HttpRequest; | |
| import java.net.http.HttpResponse; | |
| import lombok.AccessLevel; | |
| import lombok.NoArgsConstructor; |
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
| # get_wk_token.py // jeffehobbs@gmail.com // Nov. 2022 | |
| # from documentation here, which you should read first: | |
| # https://developer.apple.com/documentation/weatherkitrestapi/request_authentication_for_weatherkit_rest_api | |
| # | |
| # 1. Have a valid ADC acount. https://developer.apple.com | |
| # 2. Download this script, and open it in a text editor. You'll have to change three variables. | |
| # 3. Make up a reverse-domain name service ID (i.e., com.domain.app). Place this in SERVICE_ID. | |
| # 4. Create an ADC service identifier. https://developer.apple.com/account/resources/identifiers/add/bundleId | |
| # 5. Create an ADC service key. https://developer.apple.com/account/resources/authkeys/add | |
| # 6. Download that service key, rename to 'wkservicekey.p8', and move it into same directory as this script. |
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
| // ============================================================================= | |
| // XNU kperf/kpc demo | |
| // Available for 64-bit Intel/Apple Silicon, macOS/iOS, with root privileges | |
| // | |
| // | |
| // Demo 1 (profile a function in current thread): | |
| // 1. Open directory '/usr/share/kpep/', find your CPU PMC database. | |
| // M1 (Pro/Max/Ultra): /usr/share/kpep/a14.plist | |
| // M2 (Pro/Max): /usr/share/kpep/a15.plist | |
| // M3: /usr/share/kpep/as1.plist |
This list is no longer updated, thus the information is no longer reliable.
You can see the latest version (from october 2022) here
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
| /** | |
| * Primitive load-balancer to split Cypress specs across multiple runners. This script assumes that | |
| * all your specs are in the folder '<project root>/cypress/integration'. It uses the number of | |
| * tests per spec file as sole criteria to split specs between runners. | |
| * | |
| * This script accepts two arguments: the total number of runners and the index (starting from 0) of | |
| * the current runner. Example: | |
| * $ node cypress-partial.js 5 2 | |
| * This command asks for specs to give to the third runner of five runners. | |
| * The output of the script is a coma-separated list of specs that can be given to Cypress. Example: |
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
| Map<String, Object> args = new HashMap<>(); | |
| args.put("direction", "up"); | |
| driver.executeScript("mobile: swipe", args); |
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
| MobileElement source = (MobileElement) new WebDriverWait(driver, 30) | |
| .until(elementToBeClickable(MobileBy.AccessibilityId("slider"))); | |
| driver.addCommand(HttpMethod.POST, String.format("/session/%s/plugin/actions/swipe", driver.getSessionId()), "swipe"); | |
| driver.execute("swipe", ImmutableMap.of("elementId", source.getId(), "percentage", 50)); |
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
| MobileElement slider = driver.findElementByAccessibilityId("slider"); | |
| Point source = slider.getLocation(); | |
| PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger"); | |
| Sequence sequence = new Sequence(finger, 1); | |
| sequence.addAction(finger.createPointerMove(ofMillis(0), | |
| PointerInput.Origin.viewport(), source.x, source.y)); | |
| sequence.addAction(finger.createPointerDown(PointerInput.MouseButton.MIDDLE.asArg())); | |
| sequence.addAction(new Pause(finger, ofMillis(600))); | |
| sequence.addAction(finger.createPointerMove(ofMillis(600), |
NewerOlder