This file contains 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 | |
/* Plugin Name: P2 Resolved Posts | |
* Description: Allows you to mark P2 posts for resolution. | |
* Author: Andrew Nacin | |
* Author URI: http://andrewnacin.com/ | |
*/ | |
/* WARNING about studying and copying this code: | |
* | |
* P2 is not currently an ideal platform for developing extensions. Some of this |
This file contains 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 | |
/* Plugin Name: Grist Authors | |
* Description: Handles a special 'Author' post type and co-authors for posts. | |
* Author: Andrew Nacin | |
* Author URI: http://andrewnacin.com/ | |
*/ | |
class Grist_Authors { | |
static function init() { |
This file contains 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 | |
/** | |
* Implementation of WordPress style hooks. | |
* | |
* @author Christopher Davis <chris [AT] classicalguitar.org> | |
* @copyright Christopher Davis 2012 | |
* @license MIT | |
*/ | |
class Hooks |
This file contains 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
$.fn.typer = function(text, options){ | |
options = $.extend({}, { | |
char: ' ', | |
delay: 1000, | |
duration: 600, | |
endless: true | |
}, options || text); | |
text = $.isPlainObject(text) ? options.text : text; |
This file contains 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
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
This file contains 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 | |
use Illuminate\Support\Contracts\ArrayableInterface; | |
use Illuminate\Support\Contracts\JsonableInterface; | |
class Excel implements ArrayableInterface, JsonableInterface{ | |
protected $objPHPExcel; | |
public function __construct($file){ | |
if($file instanceof \SplFileInfo){ | |
$filename = $file->getRealPath(); |
This file contains 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 Json | |
{ | |
private static $messages = array( | |
JSON_ERROR_DEPTH => 'The maximum stack depth has been exceeded', | |
JSON_ERROR_STATE_MISMATCH => 'Syntax error, malformed JSON', | |
JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', | |
JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', | |
5 /*JSON_ERROR_UTF8*/ => 'Invalid UTF-8 sequence', | |
6 /*JSON_ERROR_RECURSION*/ => 'Recursion detected', |
This file contains 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 | |
/** | |
* Quick and dirty way to mostly minify CSS. | |
* | |
* @since 1.0.0 | |
* @author Gary Jones | |
* | |
* @param string $css CSS to minify | |
* @return string Minified CSS | |
*/ |
This file contains 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
This build uses Google's Closure Compiler solely for its error output, allowing you to use NppExec | |
for a quick syntax sanity check while editing JavaScript files, using F6 to cycle through any syntax | |
errors the compiler flags up. | |
To add the build: | |
1. Install NppExec plugin using Plugin Manager or download it from http://bit.ly/tHIUs and restart Notepad++ | |
2. Download the Closure compiler.jar from http://code.google.com/closure/compiler/ and place it somewhere | |
on your computer. An easy place to do so is to save it directly to C:\ to avoid path issues. | |
3. On Notepad++ hit F6 |
This file contains 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 | |
/** | |
* A function to sort data array element by one or two sub keys, both directions | |
*/ | |
function sksort(&$array, $subkey = "id", $subkey2 = null ,$sort_ascending=false) | |
{ | |
if (count($array)) | |
$temp_array[key($array)] = array_shift($array); |
OlderNewer