Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.
@jtwiest
jtwiest / emergence-delete-site
Last active July 23, 2019 16:35
Backup and delete emergence site from server
#!/bin/bash
# Backup and delete given emergence site
# sudo ./delete-site y handle1 handle2
# Configure backup flag
backup="y"
if [ "$1" == "n" ] || [ "$1" == "y" ]; then
backup="$1"
else
echo "Missing backup param y/n"
{
"order_id":2566,
"created_at":"2019-05-12T10:14:08-04:00",
"is_tax_exempt":false,
"notes":"Here is a delivery note.",
"service_type":"Delivery",
"tip":"4.62",
"tax":"1.11",
"shipping":"3.07",
"discount":"1.00",
@jtwiest
jtwiest / latlng_distance
Created February 22, 2017 20:15
Return the distance between two points
/**
* Returns the distance between two given lat / lngs
* in miles.
*
* @params float $lat1
* @params float $lng1
* @params float $lat2
* @params float $lng2
* @return float
*/
@jtwiest
jtwiest / CloudMessaging.php
Created July 14, 2016 00:54
Firebase Cloud Messaging Curl Wrapper
<?php
namespace Firebase;
class CloudMessaging
{
public static $authKey = '';
public static function sendMessage($title, $body, $to, $data = [], $priority = 'high')
{
@jtwiest
jtwiest / twillio.php
Last active December 21, 2016 00:42
Twillio Connector
<?php
class Twillio
{
public static $sid = '';
public static $token = '';
public static $from = '';
/*
* Make outgoing call to specified number
@jtwiest
jtwiest / gist:91dc87ecff82af1e3b34
Last active May 12, 2016 10:54
xCode Default Fonts
To install custom font
1. Drag and Drop font into xcode project
2. Make sure you add to target
- To ensure check the font is included in Target -> Build Phases -> Copy Bundle Resources -> FontName.ttf
3. Add font to target plist
- Should be under "Fonts provided by application" (array)
Value is font file name ie. Oswald-Regular.ttf
4. Use below list generator to find specific font name
5. UIFont *myFont = [UIFont fontWithName:@"Oswald-Regular" size: 22.0];
@jtwiest
jtwiest / gist:a2fdcbbaf3150f50685a
Created December 31, 2014 17:50
Get Facebook Hash for Android
import java.security.MessageDigest;
import android.content.pm.PackageManager.NameNotFoundException;
import java.security.NoSuchAlgorithmException;
import android.util.Base64;
import android.content.pm.PackageInfo;
# Put this in your main Acitiviy
try {
PackageInfo info = getPackageManager().getPackageInfo("com.sourcefuse.kudzoo", PackageManager.GET_SIGNATURES);