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
INSERT INTO `wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`, `display_name`) VALUES ('1000', 'tempuser', MD5('Str0ngPa55!'), 'tempuser', '[email protected]', '0', 'Temp User'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '1000', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '1000', 'wp_user_level', '10'); |
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
____ | |
_.' : `._ | |
.-.'`. ; .'`.-. | |
__ / : ___\ ; /___ ; \ __ | |
,'_ ""=-.:__;".-.";: :".-.":__;.-="" _`, | |
:' `.t""=-.. '<@.`;_ ',@:` ..-=""j.' `; | |
`:-.._J '-.-'L__ `-.-' L_..-;' | |
"-.__ ; .-" "-. : __.-" | |
L ' /.======.\ ' J | |
"-. "__" .-" |
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
$username = "some-username"; | |
$password = "some-password"; | |
$remote_url = 'http://www.somedomain.com/path/to/file'; | |
// Create a stream | |
$opts = array( | |
'http'=>array( | |
'method'=>"GET", | |
'header' => "Authorization: Basic " . base64_encode("$username:$password") | |
) |
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
// | |
// Usage... for a nested structure | |
// var test = { | |
// nested: { | |
// value: 'Read Correctly' | |
// } | |
// }; | |
// safeRead(test, 'nested', 'value'); // returns 'Read Correctly' | |
// safeRead(test, 'missing', 'value'); // returns '' | |
// |
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 getDigest() { | |
// mod_php | |
if (isset($_SERVER['PHP_AUTH_DIGEST'])) { | |
$digest = $_SERVER['PHP_AUTH_DIGEST']; | |
// most other servers | |
} elseif (isset($_SERVER['HTTP_AUTHENTICATION'])) { | |
if (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']),'digest')===0) | |
$digest = substr($_SERVER['HTTP_AUTHORIZATION'], 7); |
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
$password = null; | |
// mod_php | |
if (isset($_SERVER['PHP_AUTH_USER'])) { | |
$username = $_SERVER['PHP_AUTH_USER']; | |
$password = $_SERVER['PHP_AUTH_PW']; | |
// most other servers | |
} elseif (isset($_SERVER['HTTP_AUTHENTICATION'])) { |
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
// GENERAL FUNCTIONS | |
function popupwindow(url, title, w, h) { | |
var left = (screen.width/2)-(w/2); | |
var top = (screen.height/2)-(h/2); | |
return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); | |
} | |
$(function() { | |
// VIDEO |
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 addClasses (el, classes) { | |
classes = Array.prototype.slice.call (arguments, 1); | |
console.log (classes); | |
for (var i = classes.length; i--;) { | |
classes[i] = classes[i].trim ().split (/\s*,\s*|\s+/); | |
for (var j = classes[i].length; j--;) | |
el.classList.add (classes[i][j]); | |
} | |
} |
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 base64_encode(data) { | |
// example 1: base64_encode('Foo Bar'); | |
// returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA==' | |
// example 2: base64_encode('a'); | |
// returns 2: 'YQ==' | |
var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; | |
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, | |
ac = 0, | |
enc = '', |
OlderNewer