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
(function( $ ){ | |
$.fn.onHold= function(time,action) { | |
this.data('onHold_selected',false); | |
this.mousedown(function(){ | |
$(this).data('onHold_selected',true); | |
var object = this; | |
setTimeout(function(){ | |
if($(object).data('onHold_selected')){ | |
action(); | |
} |
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 | |
/* | |
* Outputs a color (#000000) based Text input | |
* | |
* @param $text String of text | |
* @param $min_brightness Integer between 0 and 100 | |
* @param $spec Integer between 2-10, determines how unique each color will be | |
*/ | |
function genColorCodeFromText($text,$min_brightness=100,$spec=10) |
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
--Written by Kevin Gravier | |
--Edit and redistribute as you please but leave this header. | |
property lastURL : "http://link.to.file" | |
property lastThreads : 4 | |
set link to text returned of (display dialog "What do you want to download?" buttons {"OK"} default button 1 default answer lastURL with icon 1) | |
set lastURL to link | |
set threads to text returned of (display dialog "How many threads?" buttons {"OK"} default button 1 default answer lastThreads with icon 1) | |
set lastThreads to threads |
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 | |
/** | |
* JApi, short of JSON API, is an action handler for Yii. | |
* | |
* JApi maps requests in the form ?r=controller/japu&action=method to controller->japiMethod. Then, anything returned from | |
* japiMethod is encoded in JSON and sent to the client. Parameters in the function are mapped to _GET varibles. JApi | |
* follows the requirments of the parameters, such as optional and required. | |
* | |
* EXAMPLE: | |
in ExampleController.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
#!/bin/sh | |
### Floating Clock ###################################################### | |
# Created by Scott Garrett https://github.com/Wintervenom # | |
# Found via https://bbs.archlinux.org/viewtopic.php?pid=557778#p557778 # | |
# Maintained By Kevin Gravier <[email protected]> # | |
######################################################################### | |
cols=`tput cols` |
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 TPM { | |
public $useCtime = true; //If true, use current time for tpm calculation. If false, use last tick. | |
public $purgeOlderThan = 15; //Time in minutes to purge old data | |
private $ticks = array(); | |
//Add a tick | |
public function tick(){ |
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
#!/usr/bin/env php | |
<?php | |
if(!isset($argv[1]) or !is_numeric($argv[1]) or strlen($argv[1]) != 4){ | |
$cmd = $argv[0]; | |
echo <<<out | |
See the number of weekend in each month, quarter, and yearly. | |
Usage: $cmd yyyy |
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
$types = array( | |
'ai' => 'application/postscript', | |
'aif' => 'audio/x-aiff', | |
'aifc' => 'audio/x-aiff', | |
'aiff' => 'audio/x-aiff', | |
'asc' => 'text/plain', | |
'atom' => 'application/atom+xml', | |
'atom' => 'application/atom+xml', | |
'au' => 'audio/basic', | |
'avi' => 'video/x-msvideo', |
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 | |
// Code snippet to extract the icon from an exe file on a Linux system -- tested on Debian Wheezy | |
// Install icoutils on your system e.g. sudo apt-get install icoutils | |
// Web process must have write privileges to /tmp | |
///** Config **/// | |
$input_file = '/path/to/program.exe'; |
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 | |
proc_nice(19); //Lowers niceness | |
set_time_limit(0); //Removes timelimit of script | |
/**** | |
... | |
Do some very intensive task you do not want to bog down your server | |
... | |
****/ |
OlderNewer