Skip to content

Instantly share code, notes, and snippets.

/*
http://www.JSON.org/json2.js
2010-08-25
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
@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 / 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 / jade_shim.js
Created August 27, 2013 00:51
When you pre-compile your jade templates for the browser, interpolated locals will still require jade.escape, but it's a simple fix, and here it is!
// this is required in order to properly escape
// jade interpolation
jade = {
escape: function(html){
return String(html)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;');
}
@atheken
atheken / grunt_supervisor.js
Last active December 21, 2015 18:19
Stupid simple spawn, allows for supervisor to be run and prevents it from being restarted each time.
var proc = null;
grunt.registerTask('supervisor', function(){
if(!proc){
proc = grunt.util.spawn(this.options());
}
});
grunt.initConfig({
supervisor : {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using MonoTouch.UIKit;
namespace Async.iOS
{
public static class Layout
{