Skip to content

Instantly share code, notes, and snippets.

View jessedc's full-sized avatar

Jesse Collis jessedc

View GitHub Profile
@jessedc
jessedc / index.js
Created February 7, 2016 20:28
Clout Kit Web Services using server to server token
(function() {
/**
* This is an example fetching /users/current from cloud kit with a server to server token without utilising aplpe's cloudkit.js
* https://developer.apple.com/library/ios/samplecode/CloudAtlas/Listings/Node_node_client_s2s_index_js.html#//apple_ref/doc/uid/TP40014599-Node_node_client_s2s_index_js-DontLinkElementID_22
*/
const https = require('https');
var fs = require('fs');
var crypto = require('crypto');
@jessedc
jessedc / gist:12a74aff88d06e669cf1c9999408c62c
Created January 13, 2019 00:22
xcodebuild --help ExportOptions.plist organised in a more logical way
ExportOptions.plist - Options in a better order
Xcodebuild manfile says the following
> **Distributing Archives**
> The -exportArchive option specifies that xcodebuild should distribute the archive specified by -archivePath using the options specified by
> -exportOptionsPlist. xcodebuild -help can print the full set of available inputs to -exportOptionsPlist. The product can either be uploaded to Apple or
> exported locally. The exported product will be placed at the path specified by -exportPath.
The following is the list of settings (as of Xcode 10.1) output by `xcodebuild --help` but in a more logical order.
@jessedc
jessedc / extract.sh
Created March 6, 2014 06:03
Extract entitlements from the provisioning profile
security cms -D -i AppStore.mobileprovision > tmp.plist && /usr/libexec/PlistBuddy -x -c 'Print:Entitlements' tmp.plist
@jessedc
jessedc / ValueKeys.cs
Last active August 23, 2021 04:05
VTankLoot File Annotated
enum StringValueKey
{
Name = 1,
Title = 5,
Inscription = 7,
InscribedBy = 8,
FellowshipName = 10,
UsageInstructions = 14,
SimpleDescription = 15,
FullDescription = 16,
@jessedc
jessedc / diyBMS-demo-build.jpg
Last active April 3, 2021 13:01
DiyBMS PartsList / Bill of Materials
diyBMS-demo-build.jpg
@jessedc
jessedc / readme.md
Last active November 7, 2019 17:46
How to Build Laravel Homestead vagrant base box from Source

How to build the Laravel Homestead base box (settler) from source

Sometimes you need the latest updates from Laravel Settler the Homestead base box source.

This assumes you're on macOS and have homebrew, Vagrant and Virtualbox installed.

These instructions are a slighly expanded version of the settler readme

mkdir settler-master
@jessedc
jessedc / livestreams.md
Last active April 29, 2019 22:37
Melbourne Cocoaheads Livestreams

Melbourne CocoaHeads Livestreams

Notes

@jessedc
jessedc / vimeo-js-api.html
Last active June 17, 2018 20:59
Autoplay Vimeo Videos from outside their iframe using Javascript.
<html>
<head></head>
<body>
<!-- NOTE: ?api=1 and player_id at the end of the URL -->
<iframe id="player" width="" height="" src="http://player.vimeo.com/video/62207569?api=1&player_id=player" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
<script>
var player = $f(document.getElementById('player'));
@jessedc
jessedc / download-rds-logs.py
Last active April 30, 2018 19:29
Download all your slow query logs from an RDS instance
import boto.rds2
from datetime import datetime
db_identifier = 'DB-IDENTIFIER'
db_region = 'ap-southeast-2'
conn = boto.rds2.connect_to_region(db_region)
log_files = conn.describe_db_log_files(db_identifier, 'mysql-slowquery.log', file_size=1024)
log_files = log_files['DescribeDBLogFilesResponse']['DescribeDBLogFilesResult']['DescribeDBLogFiles']
log_files.sort(key=lambda r: r['LastWritten'], reverse=True)
@jessedc
jessedc / current-measure.ino
Created March 10, 2018 00:38
Current Sensor for Arduino
#include <Filter.h>
#include "U8glib.h"
#define RST 8 // Reset
#define CE 9 // CS
#define DC 10 // A0
#define DIN 11 // MOSI
#define CLK 12 // SCLK
#define CURR 0