View fn_to_hyper.json
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
{ | |
"title": "Fn Key → Hyper Key (⌃⌥⇧⌘)", | |
"rules": [ | |
{ | |
"description": "Fn Key → Hyper Key (⌃⌥⇧⌘)", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "fn", | |
"modifiers": { |
View image.php
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 defined('C5_EXECUTE') or die(_('Access Denied.')); | |
class ImageHelper extends Concrete5_Helper_Image { | |
/** | |
* Runs getThumbnail on the path, and then prints it out as an XHTML image | |
*/ | |
public function outputThumbnail($obj, $maxWidth, $maxHeight, $alt = null, $return = false, $crop = false) { | |
$thumb = $this->getThumbnail($obj, $maxWidth, $maxHeight, $crop); | |
if ($return) { |
View jquery.form-clear.js
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.clear = function() { | |
if (this[0].tagName.toUpperCase() !== 'FORM') { return this; } | |
return this.find(':input').each(function() { | |
if (this.type === 'radio' || this.type === 'checkbox') { | |
this.checked = false; | |
} else { | |
$(this).val(''); | |
} | |
}); | |
} |
View benchmark.php
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 | |
$scriptStart = microtime(true); | |
$iterations = 5000; | |
$longString = str_repeat('0123456789', 102 * 5); // 10 * 102 * 5 = 5k | |
if (is_file(dirname(__FILE__) . '/config/site.php')) { | |
include(dirname(__FILE__) . '/config/site.php'); | |
if (defined('DB_SERVER')) { |
View get_parameters.js
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
String.prototype.getParameters = function(key){ | |
var urlParams, | |
match, | |
pl = /\+/g, // Regex for replacing addition symbol with a space | |
search = /([^&=]+)=?([^&]*)/g, | |
decode = function (s) { return decodeURIComponent(s.replace(pl, ' ')); }, | |
query = this; | |
// this is hasty and fragile currently | |
if (query.indexOf('?') !== -1) { |
View states and counties
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
$counties = array( | |
"Alabama" => array( | |
"Autauga County", | |
"Baldwin County", | |
"Barbour County", | |
"Bibb County", | |
"Blount County", | |
"Bullock County", | |
"Butler County", | |
"Calhoun County", |
View file_relink
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 defined('C5_EXECUTE') or die("Access Denied."); ?> | |
<?php | |
/** | |
* Modify these config settings to taste. | |
* I would recommend copying your source files into the /files directory | |
* to ensure that you are going to have proper permission to traverse them. | |
*/ | |
set_time_limit(600); | |
$document_root = '/var/www/mysite/public_html'; | |
$files_root = '/var/www/mysite/public_html/files/oops'; |