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 | |
################################################################################ | |
# This script can install PHP binaries on Windows in Bash. | |
# -- quick hacked together update for downloading PHP v5.6.40 | |
# | |
# Link to this file: | |
# https://gist.github.com/kdallas/3726bcc7b86a1a270f6b955696e55c2b/raw/php-git-bash-win.sh | |
# | |
# Download latest version by command in GitBash Windows console: | |
# $ curl -Ls bit.ly/php-bash-win | bash |
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 | |
function mt_shuffle(&$array) { | |
$randArr = []; | |
$arrLength = count($array); | |
// while my array is not empty I select a random position | |
while (count($array)) { | |
//mt_rand returns a random number between two values | |
$randPos = mt_rand(0, --$arrLength); |
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 namespace RainLab\User\Components; | |
use Lang; | |
use Auth; | |
use Mail; | |
use Flash; | |
use Input; | |
use Request; | |
use Redirect; | |
use Validator; |
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 | |
/* | |
http://SOME_RELIABLE_SERVER/update_cloudflare/CLOUDFLARE_EMAIL/CLOUDFLARE_API-KEY/HOST | |
...where "update_cloudflare" is a directory containing this file (index.php) | |
...and the URL slug/segments are parsed with the following regex: | |
RewriteRule ^/update_cloudflare/([^/]+)?/?([^/]+)?/?(.*) /update_cloudflare/index.php?e=$1&k=$2&h=$3 [L,QSA] | |
which sends the following GET params: |