Skip to content

Instantly share code, notes, and snippets.


Roger Peters SmartyP

View GitHub Profile
View gist:76ca05a5c26d8e1407588b1183f16fd9
//Create a stream for the file
Stream remoteStream = null;
Stream stream = null;
int bytesToRead = 10000; // This controls how many bytes to read at a time and send to the client
byte[] buffer = new Byte[bytesToRead]; // Buffer to read bytes in chunk size specified above
// The number of bytes read
//Create a WebRequest to get the file
SmartyP / MyPlayground.playground
Created Aug 28, 2017
Swift Playground example of SnapKit with dynamic constraints (must put within a project to allow for SnapKit reference)
View MyPlayground.playground
import UIKit
import PlaygroundSupport
import SnapKit
var horzPadding = 20
var vertPadding = 20
class ActionTarget {
let closure: () -> ()
SmartyP / REPLCheatSheet.txt
Last active Dec 15, 2019
REPL Cheat Sheet
View REPLCheatSheet.txt
app.Query() // shows all details on tree that are visible (use All flag for all)
app.Flash(query) // flash/flicker the element so you can see it and make sure it’s the right one
app.WaitFor(); // wait for some amount of time
app.WaitForElement(); // wait for an element to be available
app.WaitForNoElement(); // wait for an element to not be available
app.Tap(c=>c.Marked(“Add Task”)); // tap something marked as Add Task
View ContentPageRenderer.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using UIKit;
using MyAppName.iOS.Renderers;
You can’t perform that action at this time.