Instantly share code, notes, and snippets.

View pi-instructions.md
  1. Insert SD card to mac
  2. In disk utility, or from command line, unmount the SD card disk
  3. Format the disk as FAT
  4. Install ddrescue, a better version of dd: brew install ddrescue
  5. Locate the raw disk that is used for the SD card, on my laptop, it's /dev/rdisk2
  6. Write your boot image to the SD card: sudo ddrescue -v --force boot-image-of-choice.img /dev/rdisk2
View Keybase.md

Keybase proof

I hereby claim:

  • I am atheken on github.
  • I am atheken (https://keybase.io/atheken) on keybase.
  • I have a public key ASAbplGO49Zmf-sLUTuHRka7bw0ZPbLZZJeKVZQbPd0RNgo

To claim this, I am signing this object:

View set_upstream.sh
git config --global alias.up '! git branch -u origin/$(git symbolic-ref --short HEAD)'
View copy-templates.php
<?php
// You should have already installed wildbit/postmark-php via Composer.
// This script should be run from the root directory where the 'vendor'
// folder is created by Composer.
require_once('./vendor/autoload.php');
use Postmark\PostmarkClient;
use Postmark\Models\PostmarkException;
try{
View gist:5cad91c1f26f49a225108d39ed60b25f
using Mono.Cecil;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace CecilTest
View mail.php
<?php
return [
'username' => env('<YOUR_POSTMARK_SERVER_TOKEN>'),
'password' => env('<YOUR_POSTMARK_SERVER_TOKEN>'),
'host' => env('MAIL_HOST', 'smtp.postmarkapp.com'),
// Optionally, set "smtp" to "log" if you want to trap emails during testing.
View Jawn.swift
struct Jawn {
let value:AnyObject?
var string:String? { return self.value as? String }
var int:Int? { return self.value as? Int }
var double:Double? { return self.value as? Double }
var array:[Jawn]? { return (self.value as? NSArray)?.map{Jawn($0)} }
var bool:Bool? { return self.value as? Bool }
var dictionary:[String:Jawn]? {
guard let dictionary = self.value as? NSDictionary else {
View Jawn.swift
struct Jawn {
let value:AnyObject?
var string:String? { return self.value as? String }
var int:Int? { return self.value as? Int }
var double:Double? { return self.value as? Double }
var array:[Jawn]? { return (self.value as? NSArray)?.map{Jawn($0)} }
var bool:Bool? { return self.value as? Bool }
var dictionary:[String:Jawn]? {
guard let dictionary = self.value as? NSDictionary else {
View composer.json
{
"repositories": [{
"type": "composer",
"url": "https://packagist.org"
}]
}
View customURL.m
Here is what you need to do to register your app for a custom URL scheme (for the example we will use a "myapp" scheme).
1) In your Info.plist, add a new entry for CFBundleURLTypes:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>MyApp's URL</string>
<key>CFBundleURLSchemes</key>