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
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) {
ShawnMcCool / instance-reference-sugar-rfc-0.2.php
Last active Aug 29, 2015
PHP RFC: Instance Reference Sugar 0.2
View instance-reference-sugar-rfc-0.2.php
====== PHP RFC: Instance Reference Sugar ======
* Version: 0.2
* Date: 2015-03-09
* Author: Shawn McCool,
* Status: In Discussion
===== Summary =====
In order to access instance variables and methods, one must use the `$this->` prefix.
View gist:e7fea18b5695f8c499ad
ShawnMcCool / gist:6dbaae88f2701388c519
Created Mar 1, 2015
SailfishOS QML Theme Properties
View gist:6dbaae88f2701388c519
fontFamilyHeading : string
fontFamily : string
fontSizeTiny : int
fontSizeExtraSmall : int
fontSizeSmall : int
fontSizeMedium : int
fontSizeLarge : int
fontSizeExtraLarge : int
fontSizeHuge : int
itemSizeExtraSmall : float