This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Factory { | |
public function create() { | |
$class = get_called_class(); | |
$args = func_get_args(); | |
$r_class = new \ReflectionClass($class); | |
return $r_class->newInstanceArgs( $args ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Github_Packager { | |
private static $api_endpoint = 'http://github.com/api/v2/json/'; | |
private static $temp_path = './temp/'; | |
public static function list_branches ( $addon_name, $with_commits = false ) { | |
$url = self::$api_endpoint . 'repos/show/habari-extras/' . $addon_name . '/branches'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url(http://fonts.googleapis.com/css?family=Quattrocento); | |
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} | |
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} | |
audio:not([controls]){display:none;} | |
[hidden]{display:none;} | |
html{font-size:100%;overflow-y:scroll;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} | |
body{margin:0;} | |
body,button,input,select,textarea{font-family:sans-serif;} | |
a:focus{outline:thin dotted;} | |
a:hover,a:active{outline:0;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.tests.remove({slug: "foo"}) | |
db.tests.insert({slug: "foo", forms: [ {slug: "section 1", clusters: [ | |
{slug: "cluster 1", items: [1,2,3]}, | |
{slug: "cluster 2", items: [4,5,6]} | |
]}]}); | |
var map = function() { | |
this.forms.forEach(function(form){ | |
form.clusters.forEach(function(cluster){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var userAgent = navigator.userAgent.toLowerCase(); | |
jQuery.browser = { | |
version: (userAgent.match( /.+(?:rv|it|ra|ie|me|on)[\/: ]([\d.]+)/ ) || [])[1], | |
chrome: /chrome/.test( userAgent ), | |
safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ), | |
webkit: /webkit/.test( userAgent ), | |
opera: /opera/.test( userAgent ), | |
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), | |
mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<pluggable type="theme" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///d:/Owen/Documents/PluggableSchema.xsd"> | |
<name>resurrection</name> | |
<license url="http://apache.org">ASL 2.0</license> | |
<!-- one or more authors --> | |
<author url="http://asymptomatic.net">Owen Winkler</author> | |
<author url="http://sagrising.cockrumpublishing.com/">Rick Cockrum</author> | |
<copyright>Copyright 2009</copyright> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Explained (somewhat) at http://redalt.com/fluid-php-baseobject-class | |
trait FluentCreate | |
{ | |
public static function create() | |
{ | |
$class = get_called_class(); | |
$args = func_get_args(); | |
$r_class = new \ReflectionClass($class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Table overflow | |
*/ | |
#tbl { | |
width: 300px; | |
table-layout: fixed; | |
} | |
#tbl td { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ProposalPlugin extends Plugin | |
{ | |
public function action_plugin_activation( $plugin_file ) | |
{ | |
Post::add_new_type( 'proposal' ); | |
} | |
public function action_plugin_deactivation( $plugin_file ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$out = date('r') . "\n"; | |
$out .= var_export($_GET,true) . "\n"; | |
$out .= var_export($_POST,true) . "\n"; | |
file_put_contents(dirname(__FILE__) . '/update.log', $out); | |
header('Content-type: application/xml'); |