Skip to content

Instantly share code, notes, and snippets.

old and eccentric

Shawn McCool ShawnMcCool

old and eccentric
View GitHub Profile
View KalmanFilter.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Tabi.DataObjects;
namespace Tabi.Logic
public class KalmanLatLong : PositionEntry // Implementation taken from:
ShawnMcCool / .zshrc
Last active Jul 19, 2017
Moves the most recently modified file from the source directory to the destination directory.
View .zshrc
alias mvltr="~/scripts/"
alias ltr="ls -ltr"
ShawnMcCool / A Simple PHP Postmark
Last active Feb 21, 2017
Simple postmark email send / batching.
View A Simple PHP Postmark


public function sendSingleExample() {
    (new SendMailViaAPI('<postmark-server-token>'))->single(
        new Mail('sender name', 'sender email', 'recipient email', 'hello from exampletown', '<strong>this is bold</strong> this is not.')

public function sendBatchExample() {
ShawnMcCool /
Last active Jun 23, 2016
XRANDR Scripts for Dutch PHP Conference for 16:9 laptops
# "./" to enable 1024x768
# "./ off" to return
# This was made for a Thinkpad T450s, substitute your devices.
if [ "$1" = "off" ] ; then
echo "disabling"
xrandr --output DP2 --off
xrandr --output eDP1 --mode 1920x1080
ShawnMcCool / BladeParser.php
Created Nov 26, 2013
Simple Blade Tag Abstraction.
View BladeParser.php
<?php namespace Sterling\BladeParsing;
class BladeParser
protected $tags = [];
public function parse($view)
foreach ($this->tags as $tag) {
if ($tag->getMatchCount($view) > 0) $view = $tag->transform($view);
ShawnMcCool / gist:7573251
Created Nov 20, 2013
This is an example Gist.
View gist:7573251
This is just an example.. Go make you're own!
View shawn_snippets.sublime-snippet
<div class="clearfix">
<label for="$1">$2</label>
<div class="input">
<?=form_input('$1', set_value('$1'))?>
View idiomatic-ar.php
# Discussion about idiomatic ActiveRecord usage
## Please help me to determine the idiomatic approach for creating a member and attaching an invoice ONLY IF the member doesn't already have 5 invoices.
class Member extends Eloquent {
$member = Member::create([
ShawnMcCool / gist:16cac102e06d02365403
Created Jun 17, 2015
A Sequence Collecton for C#
View gist:16cac102e06d02365403
using System.Collections.Generic;
using Infrastructure;
using NUnit.Framework;
namespace Collections {
[TestFixture] public class SeqTests {
public void can_access_the_head() {
var seq = new Seq<DomainEvent>();
var first = new TestEvent();
ShawnMcCool / php-visibility
Last active Aug 29, 2015
PHP Visibility by Example
View php-visibility
namespace PrivateExample {
class Animal {
private $innermostFeelings = "HUNGER";
public function __construct() {
echo "Animal feels $this->innermostFeelings\n";
public function empathy(Animal $other) {
You can’t perform that action at this time.