Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
old and eccentric

Shawn McCool ShawnMcCool

💭
old and eccentric
View GitHub Profile
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>
@ShawnMcCool
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!
@ShawnMcCool
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
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) {
You can’t perform that action at this time.