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
/* | |
* Description: Simple IO class for php CLI | |
* Author: Mads Aune | |
*/ | |
if(!defined("STDIN")) { define('STDIN', fopen('php://stdin', 'r')); } | |
class CLI { | |
public static function getLine($prompt = '') { | |
echo $prompt . "> "; |
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($){ | |
$.widget("ui.mywidget", { | |
options: { | |
autoOpen: true | |
}, | |
_create: function(){ | |
// by default, consider this thing closed. |
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
# USE cg img; // will show 2 lines before and 15 lines after match. | |
alias cg="find . -path '*/.svn/*' -prune -o -path '*/.git/*' -prune -o -path '*compiled*' -prune -o -type f -print | xargs -e grep -A 15 -B 2 --color -rnisIe " | |
# USE f img; | |
alias f="find . -path '*/.svn/*' -prune -o -path '*/.git/*' -prune -o -path '*compiled*' -prune -o -type f -print | xargs -e grep --color -rnisIe " |
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
f 'findthistext' | xargs sed -i -e 's/findthistext/replacewiththistext/g'; | |
# replace members/upload.php with upload.php | |
f 'members\/upload\.php' | xargs sed -i -e 's/members\/upload\.php/upload\.php/g'; | |
# using my .bash_profile | |
# prevents changes to .svn and .git files!!! | |
f 'findthistext' | xargs sed -i -e 's/findthistext/replacewiththistext/g'; |
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
<!-- HEAD SECTION --> | |
<!-- IE Edge Meta Tag --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<!-- Viewport --> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.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
/*! Ejax Datatables - v0.0.1 - 2016-02-19 | |
* Copyright (c) 2016 charles peterson; Licensed MIT */ | |
(function ($) { | |
/** | |
* debug_ejax = console.log alot of crap | |
* elastic_json = the query for elastic | |
* pkey = key to define the object data structure if y`ant to | |
* serverUrl = elasticsearch server search path | |
* callbackSearch = callback to change the search for your elastic_json based on databases search updates made by the user | |
* callbackRow = callback to modify result row |
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 location_timeout = setTimeout(function () { | |
navigator.geolocation.clearWatch(WatchID); | |
self.findLocationByIP(callback); | |
}, 15000); | |
var WatchID = navigator.geolocation.watchPosition( | |
function (position) { // Success callback | |
clearTimeout(location_timeout); |
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
// use this transport for "blob" data type | |
// http://artandlogic.com/2013/11/jquery-ajax-blobs-and-array-buffers/ | |
(function($){ | |
/** | |
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2 | |
* within the comfortable framework of the jquery ajax request, with full support for promises. | |
* | |
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list | |
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the |
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 recursiveIterationKey(object,matchKey) { | |
var found=false; | |
for (var property in object) { | |
if (object.hasOwnProperty(property)) { | |
if (typeof object[property] == "object"){ | |
if(recursiveIterationKey(object[property])){ | |
found=true; | |
break; | |
} else if(matchKey==property) { | |
found = true; |
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
Object.prototype.join = function(glue, separator) { | |
var object = this; | |
if (glue == undefined) | |
glue = '='; | |
if (separator == undefined) | |
separator = ','; | |
return $.map(Object.getOwnPropertyNames(object), function(k) { return [k, object[k]].join(glue) }).join(separator); |