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
UPDATE | |
wp_options | |
SET | |
option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') | |
WHERE | |
option_name = 'home' OR | |
option_name = 'siteurl'; | |
#option_name = 'wsl_settings_redirect_url'; | |
UPDATE |
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
/** | |
* Questo metodo prende l'header di una response e restituisce un array associativo | |
* @param $response | |
* @return array | |
*/ | |
private function get_headers_from_curl_response($response) | |
{ | |
$headers = array(); | |
$header_text = substr($response, 0, strpos($response, "\r\n\r\n")); | |
foreach (explode("\r\n", $header_text) as $i => $line) { |
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
curl -X PURGE -H 'X-Forwarded-Proto: https' url |
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 | |
// Next two functions taken from a commenter on http://php.net/manual/en/function.unserialize.php | |
function unserialize_recursive($val) { | |
//$pattern = "/.*\{(.*)\}/"; | |
if(is_serialized($val)){ | |
$val = trim($val); | |
$ret = unserialize($val); | |
if (is_array($ret)) { | |
foreach($ret as &$r) $r = unserialize_recursive($r); |
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
paste file1 file2 | awk -F "[,\t]" '{for(i=1;i<=(NF/2);i++){if($i != $(NF/2+i)){ | |
if(s){s=s";"$i}else{s=$i}}else{if(s){s=s";,"}else{s=","}}}}{ print s;s=""}' |
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
apachectl -t -D DUMP_MODULES |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// SOUND REACTIVE LED TEST by Antinum | |
// Don't abruptly steal, but a comment in your source code crediting me is fine. | |
// HOWEVER this code is probably quite messy and can be tweaked quite a bit | |
// Have fun with this, though :) | |
//FOUND FROM THIS YOUTUBE VIDEO http://youtu.be/c3DFLFITaG0 | |
const byte totalLeds=11; | |
int incomingAudio[30]={}; | |
int averageAudio=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
# Why rewrite URLs? Read this: http://en.wikipedia.org/wiki/Rewrite_engine | |
# Apache (.htaccess or httpd.conf) | |
# Make sure AllowOverride is on for the directory, or put the rewrite rules in httpd.conf | |
# http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule . /index.php [L] | |
# Nginx (nginx.conf) |
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 | |
// Next two functions taken from a commenter on http://php.net/manual/en/function.unserialize.php | |
function unserialize_recursive($val) { | |
//$pattern = "/.*\{(.*)\}/"; | |
if(is_serialized($val)){ | |
$val = trim($val); | |
$ret = unserialize($val); | |
if (is_array($ret)) { | |
foreach($ret as &$r) $r = unserialize_recursive($r); |