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 | |
/** | |
* Password Hash Cost Calculator | |
* | |
* Set the ideal time that you want a password_hash() call to take and this | |
* script will keep testing until it finds the ideal cost value and let you | |
* know what to set it to when it has finished | |
*/ | |
// Milliseconds that a hash should take (ideally) |
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
import sys, os | |
import shutil | |
import math | |
import itertools | |
from copy import deepcopy | |
# 0 1 2 3 4 5 6 | |
LIST_elmt = [" ("," (start ",") (end ",") "," (layer ",") ","))"] | |
#LIST_elmt = [" (gr_line (start 131.571908 182.314571) (end 112.874456 120.68499) (angle 90) (layer Dwgs.User) (width 0.1))"] | |
#LIST_elmt = [" (segment (start 118.7 106.7) (end 119.4 106.7) (width 0.25) (layer B.Cu) (net 0))"] |
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
# 301 Redirects for .htaccess | |
# =========================== | |
# Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
# Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
# Redirect an entire site to a subfolder |
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 prefered_language($available_languages, $http_accept_language) { | |
$available_languages = array_flip($available_languages); | |
$langs = array(); | |
preg_match_all('~([\w-]+)(?:[^,\d]+([\d.]+))?~', strtolower($http_accept_language), $matches, PREG_SET_ORDER); | |
foreach($matches as $match) { | |
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
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |