Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
old and eccentric

Shawn McCool ShawnMcCool

💭
old and eccentric
View GitHub Profile
@ShawnMcCool
ShawnMcCool / gist:8735217
Created Jan 31, 2014
This is an example gist
View gist:8735217
Beep Boop Beep, I'm a computer.
@ShawnMcCool
ShawnMcCool / gist:c1e7b62e94ab58f6e8d0
Last active Aug 29, 2015
Why a closure is called a closure.
View gist:c1e7b62e94ab58f6e8d0
// 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 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
View gist:e7fea18b5695f8c499ad
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 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, 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 Aug 29, 2015
PHP Visibility by Example
View php-visibility
<?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 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 {
[Test]
public void can_access_the_head() {
var seq = new Seq<DomainEvent>();
var first = new TestEvent();
View idiomatic-ar.php
<?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([
View shawn_snippets.sublime-snippet
<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>
You can’t perform that action at this time.