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 | |
// Adds @asset tag to blade templates; | |
// USAGE: @asset('path/to/file.css|js') | |
Blade::extend(function($view, \Illuminate\View\Compilers\BladeCompiler $compiler) | |
{ | |
$pattern = $compiler->createMatcher('asset'); | |
return preg_replace($pattern, '<?php Assets::add$2; ?>', $view); | |
}); |
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
-- TurbineMonitor | |
-- Made By: MrKMG <mrkmg.com> | |
-- | |
-- This program will keep your turbines up to speed and turn | |
-- the coil on and off as needed. | |
-- | |
-- To Use: | |
-- | |
-- Attach as many Turbines and Monitors as you would like via | |
-- wired modems. Monitors will all display the same information |
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
--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 <kevin@mrkmg.com> # | |
######################################################################### | |
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
var Promise = require("bluebird"); | |
function doSomething() | |
{ | |
return Promise | |
.try(function () | |
{ | |
return task1(); | |
}) | |
.then(function (result) |
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
// ==UserScript== | |
// @name New Coffee-Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description shows how to use coffeescript compiler | |
// @author You | |
// @require http://coffeescript.org/extras/coffee-script.js | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// @match https://speed.cd/browse.php* | |
// ==/UserScript== |
OlderNewer