var $$ = function(param) { | |
var node = $(param)[0]; | |
var id = $.data(node); | |
$.cache[id] = $.cache[id] || {}; | |
$.cache[id].node = node; | |
return $.cache[id]; | |
}; | |
// Now, instead of doing $("#foo").data("foo") and ("#foo").data("foo", "bar"), | |
// you can do $$("#foo").foo and $$("#foo").foo = bar. |
# encode html | |
escape = (text) -> | |
replacements = | |
[/&/g, '&'] | |
[/</g, '<'] | |
[/"/g, '"'] | |
[/'/g, '''] | |
for r in replacements | |
text.replace r[0], r[1] |
<?php | |
/* | |
* PHP: Recursively Backup Files & Folders to ZIP-File | |
* MIT-License - 2012-2018 Marvin Menzerath | |
*/ | |
// Make sure the script can handle large folders/files | |
ini_set('max_execution_time', 600); | |
ini_set('memory_limit', '1024M'); |
Simple Dashing widget that tracks time since a certain event. Time Since Last waits for request to be made to your instance of Dashing and will then reset the time since the last occurrence of whatever event you would like to track. An example could be the time since the last exception for one of your applications, or the time since the last accident on the workfloor (better keep that widget green)!
The widget was made by @hannesfostie for use @openminds. If you end up using this widget, please send me a tweet! I'd love to hear about it.
This widget requires HTML5's localStorage in order to keep track of the last time the event occurred in order for it to work across restarts and refreshes.
<?php | |
/* strpos that takes an array of values to match against a string note the stupid argument order (to match strpos) */ | |
function strpos_arr($haystack, $needle) { | |
if(!is_array($needle)) $needle = array($needle); | |
foreach($needle as $what) { | |
if(($pos = strpos($haystack, $what))!==false) return $pos; | |
} | |
return false; | |
} |
A Dashing widget that checks whether a server is responding to either an http or ping request. It displays either a check or alert depending on the response.
Weatheroutlook Dashing Widget displays a 5-days weather outlook from Yahoo! Weather using Climacons Font.