Skip to content

Instantly share code, notes, and snippets.

@atheken
atheken / pi-instructions.md
Last active February 9, 2018 18:40
Writing Images for Raspberry Pi SD Cards (mac os)
  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
@atheken
atheken / Keybase.md
Created October 10, 2017 00:14
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 March 2, 2017 20:44
Set the upstream branch to the same as the current for git.
git config --global alias.up '! git branch -u origin/$(git symbolic-ref --short HEAD)'
@atheken
atheken / copy-templates.php
Created February 20, 2017 21:08
A quick template copying script using postmark-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 January 9, 2017 20:20 — forked from MatthewSteeples/gist:5588087
Code to rename namespaces from compiled assemblies using Mono.Cecil
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 October 5, 2018 07:26
Example `config/mail.php` to send mail using Postmark from Laravel
<?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 November 12, 2015 14:55
Super lazy JSON lookups.
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 November 12, 2015 14:53
Super lazy JSON lookups.
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 August 21, 2015 14:55
Fix packagist url for composer on OS X
{
"repositories": [{
"type": "composer",
"url": "https://packagist.org"
}]
}
@atheken
atheken / customURL.m
Last active August 29, 2015 14:20 — forked from deivuh/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>