Skip to content

Instantly share code, notes, and snippets.

View sjehutch's full-sized avatar

scott hutchinson sjehutch

View GitHub Profile
//: Playground - noun: a place where people can play
import UIKit
var basic_premiuma = [
[10000, 10000, 238],
[10001, 10500, 242],
[10501, 11000, 244],
[11001, 11500, 248],
[11501, 12000, 252],
@sjehutch
sjehutch / sns_webhook.php
Created November 3, 2017 13:50
Webhook in lambda api gateway for sns
<?php
require 'path/to/vendor/autoload.php';
use AwsSnsMessageValidatorMessage;
use AwsSnsMessageValidatorMessageValidator;
use GuzzleHttpClient;
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
@sjehutch
sjehutch / button.cs
Created November 15, 2017 02:09
xamarin button treatment
public static void SetupButtonBorder(UIButton btn)
{
btn.Layer.BorderColor = UIColor.White.CGColor;
btn.Layer.BorderWidth = 1;
btn.Layer.CornerRadius = 4;
}
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);
{
"task_types": [
{
"attributes": {
"type": "Service_Request_Task_Type__c",
"url": "/services/data/v40.0/sobjects/Service_Request_Task_Type__c/a3p550000008b7MAAQ"
},
"Id": "a3p550000008b7MAAQ",
"OwnerId": "00555000001q9A9AAI",
"IsDeleted": false,
using System;
using System.Collections.Generic;
using Foundation;
using System.Linq;
using UIKit;
namespace SharediOS.UI
{
//This class has methods for buttons mainly
@sjehutch
sjehutch / gist:f34e3245ba7a17aea51261b63e0ec8c9
Last active November 17, 2017 21:43
open email xamarin ios
testButton1.TouchUpInside += delegate {
Device.OpenUri(new Uri("mailto:[email protected]"));
};
// Cleanup
testButton1.TouchUpInside -= HandleTouchUpInside;
partial void btnSupport_(UIButton sender)
{
var uri = new Uri("mailto:" + Constants.SUPPORT_EMAIL);
UIApplication.SharedApplication.OpenUrl(new NSUrl(uri.ToString()));
}
if (String.IsNullOrWhiteSpace(txtUserName.Text))
@sjehutch
sjehutch / gist:9f50d0301f29853dffdd757b4e528279
Created November 21, 2017 14:58
check for null entry textbox xamarin
private void btnSign_touchUp(object sender, EventArgs e)
{
if (!IsValid)
{
var okAlertController = UIAlertController.Create("Alert", _validationError, UIAlertControllerStyle.Alert);
okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, (action) => { }));
UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(okAlertController, true, null);
return;
@sjehutch
sjehutch / gist:c3d821914704c355603f33146c1eca77
Created November 25, 2017 00:55
resign keyboard xamarin IOS
public override void TouchesBegan(NSSet touches, UIEvent evt)
{
txtUserName.ResignFirstResponder();
}
//Dismiss Keyboard After hitting return
txtPassword.ShouldReturn = (sender) =>
{
sender.ResignFirstResponder();
return false;