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 bash | |
# -- configuration | |
SIGINT_COUNT_IMMEDIATELY=2 | |
cmd_help() | |
{ | |
# Display Help | |
echo "A simple file-based pull queue solution to watch a file every [-s] seconds, and execute a command with [-n] items" |
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 python3 | |
import argparse | |
import string | |
import subprocess | |
from secrets import choice, token_urlsafe | |
Algorithms = { | |
"pronounceable": (lambda password_generator: "p-" + token_urlsafe(password_generator.length)), | |
"pin": (lambda password_generator: password_generator.fromSeq(string.digits)), |
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 | |
/** | |
* FileSystemStreamWrapper | |
* | |
* @author Dustin Breuer <gist@thedust.in> | |
*/ | |
/** | |
* Class FileSystemStreamWrapper | |
* |
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 anchor = document.createElement("a"), | |
props = ["href", "protocol", "host", "hostname", "port", "pathname", "search", "hash", "username", "password", "origin"], | |
result = {}, i, j; | |
anchor.setAttribute("href", "//user:pass@hostname:8080/pathname/?q=search#hash"); | |
for(i = 0, j = props.length; i < j; i++){ | |
result[props[i]] = anchor[props[i]]; | |
} |
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
jQuery(function($){ | |
var maxHeight = Math.round( $( window ).height() * 0.6 ); | |
$('#TextArea').on( 'keyup input paste cut', function() { | |
$(this) | |
.css( 'height', '' ) | |
.css( 'height', Math.min( this.scrollHeight, maxHeight ) ); | |
} ); | |
}); |
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
/** | |
* Avoid `console` errors in browsers that lack a console. | |
* @link https://github.com/h5bp/html5-boilerplate/blob/master/src/js/plugins.js | |
*/ | |
(function() { | |
var method, | |
noop = function() {}, | |
methods = [ | |
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', |
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 | |
$aHeaders = getAllHeaders(); | |
header('X-Mirror-Http-Method: ' . $_SERVER['REQUEST_METHOD']); | |
foreach($aHeaders as $sName => $sValue){ | |
header(sprintf('X-Mirror-%s: %s', $sName, $sValue)); | |
} | |
echo file_get_contents('php://input'); |
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 | |
// $arrUrls = ["http://...", ...] | |
$arrCurls = array(); | |
$resMultiCurl = curl_multi_init(); | |
$arrReturn = array(); | |
foreach ( $arrUrls as $strUrl ) { | |
$resCurl = curl_init(); |
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
/** | |
* | |
* @param {Number} iFrom | |
* @param {Number} iTo | |
* @param {Number} iDuration | |
* @param {Function} cSetterFunction | |
*/ | |
function simpleAnimatedValue(iFrom, iTo, iDuration, cSetterFunction){ | |
var iDiff = (iTo - iFrom), | |
iAnimationEnd = (Date.now() + iDuration), |
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 | |
/** | |
* ArrayUtils | |
* | |
* @author Dustin Breuer <developer@thedust.in> | |
* @license 2015 MIT | |
*/ | |
namespace TheDusti\Util; |
NewerOlder