Skip to content

Instantly share code, notes, and snippets.

View wilsonmar's full-sized avatar
💭
I may be slow to respond.

Wilson Mar wilsonmar

💭
I may be slow to respond.
View GitHub Profile
@wilsonmar
wilsonmar / gripme.sh
Last active March 14, 2016 12:04
Shell file to supply credentials for grip server to format readme files
grip --user mememe@me.com --pass ... $* 6419
import java.io.*;
import java.net.*;
public class AprilTagReceive
{
public static void main(String args[]) throws IOException
{
DatagramSocket sock = new DatagramSocket(7709);
byte buf[] = new byte[65536];
@wilsonmar
wilsonmar / git_move.sh
Last active February 2, 2016 22:51
moves a folder from one git repo into another repo with history intact
#!/usr/bin/env bash
# (forked from https://gist.github.com/gregferrell/942639)
# Usage:
# ./git_move.sh git@repo_site.com:/my_repo.git origin/folder/path/ /destination/repo/path/ new/folder/path/
# To prevent who repos being wiped out by blank options:
if [ $# -lt 4 ] ; then
echo "Usage: $0 git@repo_site.com:/my_repo.git origin/folder/path/ /destination/repo/path/ new/folder/path/"
@wilsonmar
wilsonmar / Powershell
Created March 17, 2015 18:21
Chocolatey install on Windows using Powershell
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
@wilsonmar
wilsonmar / gist:760d6bfad69090a49dd2
Created March 16, 2015 15:51
Java execution timer
// From http://www.rgagnon.com/javadetails/java-0132.html
// quoted in http://stackoverflow.com/questions/5471700/is-there-a-command-in-java-to-measure-the-execution-time
public class ExecutionTimer {
private long start;
private long end;
public ExecutionTimer() {
reset();
start = System.currentTimeMillis();
@wilsonmar
wilsonmar / gist:fa87d71a8f116dd5dc40
Last active August 29, 2015 14:17
Selenium response time timer
// From http://qtpseleniumsudhakar.blogspot.com/2014/02/measuring-response-time-using-timer-in.html
// Get the Start Time
long startTime = System.currentTimeMillis();
// Sample app: Open the BMI Calculator Mobile Application
driver.get("http://dl.dropbox.com/u/55228056/bmicalculator.html");
// Wait for the Calculate Button
new WebDriverWait(driver, 10).until(ExpectedConditions.
@wilsonmar
wilsonmar / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console