Skip to content

Instantly share code, notes, and snippets.

Andrew Theken atheken

Block or report user

Report or block atheken

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@atheken
atheken / pi-instructions.md
Last active Feb 9, 2018
Writing Images for Raspberry Pi SD Cards (mac os)
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:

@atheken
atheken / set_upstream.sh
Created Mar 2, 2017
Set the upstream branch to the same as the current for git.
View set_upstream.sh
git config --global alias.up '! git branch -u origin/$(git symbolic-ref --short HEAD)'
@atheken
atheken / copy-templates.php
Created Feb 20, 2017
A quick template copying script using postmark-php.
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{
@atheken
atheken / gist:5cad91c1f26f49a225108d39ed60b25f
Created Jan 9, 2017 — forked from MatthewSteeples/gist:5588087
Code to rename namespaces from compiled assemblies using Mono.Cecil
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
@atheken
atheken / mail.php
Last active Oct 5, 2018
Example `config/mail.php` to send mail using Postmark from Laravel
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.
@atheken
atheken / Jawn.swift
Last active Nov 12, 2015
Super lazy JSON lookups.
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 {
@atheken
atheken / Jawn.swift
Created Nov 12, 2015
Super lazy JSON lookups.
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 {
@atheken
atheken / composer.json
Created Aug 21, 2015
Fix packagist url for composer on OS X
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>
You can’t perform that action at this time.