Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ShawnMcCool's full-sized avatar
💭
reinventing the wheel

Shawn McCool ShawnMcCool

💭
reinventing the wheel
View GitHub Profile
@ShawnMcCool
ShawnMcCool / gist:8735217
Created January 31, 2014 16:11
This is an example gist
Beep Boop Beep, I'm a computer.
@ShawnMcCool
ShawnMcCool / gist:c1e7b62e94ab58f6e8d0
Last active August 29, 2015 14:14
Why a closure is called a closure.
// An anonymous function written in lambda syntax:
x => x + 1
val func = x => x + 1
func(3) // returns 4
// In this case, the lambda `x => x + 1` relies on NO external data.
// It's fundamentally complete. X is provided as an argument to the function.
@ShawnMcCool
ShawnMcCool / gist:6dbaae88f2701388c519
Created March 1, 2015 14:39
SailfishOS QML Theme Properties
fontFamilyHeading : string
fontFamily : string
fontSizeTiny : int
fontSizeExtraSmall : int
fontSizeSmall : int
fontSizeMedium : int
fontSizeLarge : int
fontSizeExtraLarge : int
fontSizeHuge : int
itemSizeExtraSmall : float
@ShawnMcCool
ShawnMcCool / gist:e7fea18b5695f8c499ad
Last active August 29, 2015 14:16
Sailfish Theme Icons
com_android_browser
graphic-avatar-text-back
graphic-background
graphic-bootloader-usb-wakeup
graphic-busyindicator-large-background
graphic-busyindicator-large
graphic-busyindicator-medium-background
graphic-busyindicator-medium
graphic-busyindicator-small
graphic-button
@ShawnMcCool
ShawnMcCool / instance-reference-sugar-rfc-0.2.php
Last active August 29, 2015 14:16
PHP RFC: Instance Reference Sugar 0.2
====== PHP RFC: Instance Reference Sugar ======
* Version: 0.2
* Date: 2015-03-09
* Author: Shawn McCool, shawn@heybigname.com
* Status: In Discussion
===== Summary =====
In order to access instance variables and methods, one must use the `$this->` prefix.
@ShawnMcCool
ShawnMcCool / php-visibility
Last active August 29, 2015 14:17
PHP Visibility by Example
<?php
namespace PrivateExample {
class Animal {
private $innermostFeelings = "HUNGER";
public function __construct() {
echo "Animal feels $this->innermostFeelings\n";
}
public function empathy(Animal $other) {
@ShawnMcCool
ShawnMcCool / gist:16cac102e06d02365403
Created June 17, 2015 07:52
A Sequence Collecton for C#
using System.Collections.Generic;
using Infrastructure;
using NUnit.Framework;
namespace Collections {
[TestFixture] public class SeqTests {
[Test]
public void can_access_the_head() {
var seq = new Seq<DomainEvent>();
var first = new TestEvent();
<?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
ShawnMcCool / shawn_snippets.sublime-snippet
Created October 18, 2011 11:55
snippets are amazing
<snippet>
<content><![CDATA[
<div class="clearfix">
<label for="$1">$2</label>
<div class="input">
<?=form_input('$1', set_value('$1'))?>
</div>
</div>
]]></content>
<tabTrigger>formtext</tabTrigger>