Skip to content

Instantly share code, notes, and snippets.

View simensen's full-sized avatar
🎯
Focusing

Beau Simensen simensen

🎯
Focusing
View GitHub Profile
@aek
aek / halo_AntPathMatcher.php
Created October 18, 2010 16:42
halo_MultiActionController
<?php
class halo_AntPathMatcher implements halo_IPathMatcher {
public function match($pattern, $path){
/**
** PurSelector is an Utility class from http://www.php-pop.org
**/
return PurSelector::match($pattern, $path, true);
}
}
?>
@haraldmartin
haraldmartin / Set active Time Machine Disk.applescript
Created November 27, 2010 16:18
Set active Time Machine Disk
property pth : (path to preferences folder from local domain) as text
property d1name : "WD My Book"
property d1 : "com.apple.TimeMachine RF9.plist"
property d2name : "AirDisk"
property d2 : "com.apple.TimeMachine Home.plist"
property active : "com.apple.TimeMachine.plist"
@smoak
smoak / TwistedStuff.py
Created May 18, 2011 00:38
Twisted Stuff
from twisted.internet import reactor, defer
class Api:
def __init__(self):
self.domainObjects = None
self.subscribers = []
def test(self, url):
# code for doing the async stuff here
@mgwilliams
mgwilliams / hiera.py
Created February 22, 2012 22:07
Python script to access data from hiera...
from subprocess import check_output
import json
import collections
def hiera(key, environment, location, hostname, merge=None, preserve_order=True, bin="/usr/local/bin/hiera", confdir="/etc/puppet/"):
if preserve_order:
obj_pair_hook=collections.OrderedDict
else:
obj_pair_hook=None
@davedevelopment
davedevelopment / index.php
Created November 13, 2012 16:36
Tinkering with a Hal resource DTO, separating the framework from the app and content negotiation
<?php
namespace Demo {
require __DIR__."/vendor/autoload.php";
use Nocarrier\Hal;
class Resource extends Hal {}
class ResourceResponse
@ePirat
ePirat / Parser.js
Created January 16, 2013 21:12
Link header parser (JavaScript)
var PageLinks = function(linkHeader) {
var ProfileRel = "https://tent.io/rels/profile";
var final = [];
var links = linkHeader.split(",");
if (links.length < 2)
links[0] = linkHeader;
for (link in links) {
link = links[link];
var segments = link.split(";");
if (segments.length < 2)
@eykd
eykd / .gitignore
Created January 19, 2012 04:37
Full stack BDD testing with Behave+Mechanize+Django
*.pyc
bin/
include/
lib/
@ilkka
ilkka / tag_cloud_tag.rb
Created November 22, 2010 20:07
Jekyll tag cloud / tag pages plugin
module Jekyll
class TagCloudTag < Liquid::Tag
safe = true
def initialize(tag_name, text, tokens)
super
end
def render(context)
html = ""
@desandro
desandro / jquery.imagesloaded.js
Created January 26, 2011 18:01 — forked from paulirish/README.md
$.fn.imagesLoaded jQuery plugin
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// Modified with a two-pass approach to changing image
// src. First, the proxy imagedata is set, which leads
// to the first callback being triggered, which resets
// imagedata to the original src, which fires the final,
// user defined callback.
@tillkruss
tillkruss / app\Http\Kernel.php
Last active March 9, 2023 14:26
Running Laravel 5 on Heroku behind CloudFlare
<?php
class Kernel extends HttpKernel
{
protected $middleware = [
\App\Http\Middleware\TrustedProxies::class,
];
}