Skip to content

Instantly share code, notes, and snippets.

View sjehutch's full-sized avatar

scott hutchinson sjehutch

View GitHub Profile
@sjehutch
sjehutch / appointments-query
Created June 19, 2017 22:56
appointments-query
SELECT DISTINCTROW Appointments.AppointmentID AS qAppointmentID, Appointments.EmployeeID AS qEmployeeID, Appointments.CustomerID AS qCustomerID, Appointments.PetID AS qPetID, Appointments.AppointmentDate, Groomers.FirstName AS Groomer, Appointments.StartTime AS [Time], YesNo.Value AS [S Appt], IIf([comments] Like "** call the office **","CALL THE OFFICE",[Last Name]) AS Customer, Pets.PetName AS Pet, Breeds.Breed, "(" & [Customers].[MAPSCO City] & ") " & [Customers].[MAPSCO] AS qMAPSCO, Appointments.Comments, Appointments.Dip AS qDip, [Mapsco Color].[MAPSCO Color], YesNo_1.Value AS Pref
FROM ((((((Appointments LEFT JOIN Groomers ON Appointments.EmployeeID = Groomers.EmployeeID) LEFT JOIN Pets ON Appointments.PetID = Pets.PetID) LEFT JOIN Breeds ON Pets.BreedID = Breeds.BreedID) INNER JOIN [YesNo] ON Appointments.StandingAppt = YesNo.Argument) LEFT JOIN [Customer Query + Mapsco4] ON Appointments.CustomerID = [Customer Query + Mapsco4].CustomerID) LEFT JOIN [Mapsco Color] ON ([Customer Query + Mapsco4].MAPSCO4
lottery_player = {
"name" : "scott",
"numbers" : (1,2,3,4,5,6)
}
print (lottery_player["numbers"])
class LotterPlayer :
def __init__(self):
self.name = "Tom"
@sjehutch
sjehutch / testcshar.c
Created June 24, 2017 02:15
testcsharp
for (int i = 100 ; i > 0 ; i--) {
if (i % 2 == 0){
Console.WriteLine(i + " is even");
}
else if (i % 5 == 0) {
Console.WriteLine ("Things with a remainder of 5 are stupid");
}
else {
Console.WriteLine (i + " is odd");
@sjehutch
sjehutch / pytz.py
Created July 8, 2017 15:13
list country codes sorted
from pytz import country_timezones
timezone_country = {}
for countrycode in country_timezones:
timezones = country_timezones[countrycode]
for timezone in sorted (timezones):
timezone_country[timezone] = countrycode
print (countrycode)
@sjehutch
sjehutch / gist:f29edfd92b3ced0f896b3cc9f4bdad32
Created September 7, 2017 16:53
play video Xamarin IOS
private void onPrimaryViewClick(object sender, EventArgs e)
{
var pathOfVideoFile = NSBundle.MainBundle.PathForResource("Videos/sizzlereel", "mov");
NSUrl pathUrl = NSUrl.FromFilename (pathOfVideoFile);
AVPlayer player = new AVPlayer(pathUrl);
AVPlayerViewController playerController = new AVPlayerViewController();
@sjehutch
sjehutch / unvs.sh
Created September 15, 2017 20:34
uninstall vs Mac vi unvs.sh past the contents of the file then run chmod 777 unvs.sh then run ./unvs.sh
#!/bin/sh
# Uninstall Visual Studio for Mac
echo "Uninstalling Visual Studio for Mac..."
sudo rm -rf "/Applications/Visual Studio.app"
rm -rf ~/Library/Caches/VisualStudio
rm -rf ~/Library/Preferences/VisualStudio
rm -rf "~/Library/Preferences/Visual Studio"
rm -rf ~/Library/Logs/VisualStudio
@sjehutch
sjehutch / share.swift
Created October 14, 2017 15:00
Swift Share Function
@IBAction func shareButtonClicked(_ sender: Any) {
let textToShare = "Check out my github repo!"
if let myWebsite = NSURL(string: "http://github.com/") {
let objectsToShare = [textToShare, myWebsite] as [Any]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityVC.popoverPresentationController?.sourceView = sender as? UIView
self.present(activityVC, animated: true, completion: nil)
}
@sjehutch
sjehutch / detect_many.py
Created October 14, 2017 22:35
face comparison/detection aws
import boto3
BUCKET = "face-source-scott" ### This is the bucket where the face your trying to match lives
KEY = "rishi4.jpg" ## This is the face your are trying to match
COLLECTION = "faces" #### This is the collection of faces that you have already taught the ai to store
def search_faces_by_image(bucket, key, collection_id, threshold=80, region="us-east-1"):
rekognition = boto3.client("rekognition", region)
response = rekognition.search_faces_by_image(
Image={
@sjehutch
sjehutch / array
Created October 24, 2017 13:44
array-complex
var basic_premiuma = {
"1": [10000, 10000, 238],
"2": [10001, 10500, 242],
"3": [10501, 11000, 244],
"4": [11001, 11500, 248],
"5": [11501, 12000, 252],
"6": [12001, 12500, 255],
"7": [12501, 13000, 260],
"8": [13001, 13500, 264],
"9": [13501, 14000, 267],
import UIKit
var basic_premiuma = [
[10000, 10000, 238],
[10001, 10500, 242],
[10501, 11000, 244],
[11001, 11500, 248]
]