Skip to content

Instantly share code, notes, and snippets.

View SmartyP's full-sized avatar

Roger Peters SmartyP

View GitHub Profile
@SmartyP
SmartyP / MyPlayground.playground
Created August 28, 2017 19:53
Swift Playground example of SnapKit with dynamic constraints (must put within a project to allow for SnapKit reference)
import UIKit
import PlaygroundSupport
import SnapKit
var horzPadding = 20
var vertPadding = 20
class ActionTarget {
let closure: () -> ()
@SmartyP
SmartyP / gist:76ca05a5c26d8e1407588b1183f16fd9
Created December 15, 2017 21:40
ExcelDataReader test code
//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
try
{
//Create a WebRequest to get the file
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;
@SmartyP
SmartyP / REPLCheatSheet.txt
Last active December 15, 2019 08:44
REPL Cheat Sheet
app.Query() // shows all details on tree that are visible (use All flag for all)
app.DismissKeyboard();
app.Back();
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