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
#Install pthreads on AWS-EC2 with php5.6 | |
#!/usr/bin/env bash | |
sudo yum update -y | |
sudo yum install httpd | |
cd | |
wget https://mirror.webtatic.com/yum/el6/latest.rpm | |
sudo yum install latest.rpm -y | |
sudo yum-config-manager --enable webtatic | |
sudo yum clean all | |
sudo yum install --enablerepo=webtatic php56w php56w-bcmath php56w-gd php56w-imap php56w-mbstring php56w-mcrypt php56w-mysqlnd php56w-pear php56w-xml php56w-soap php56w-devel -y |
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 frenchChars($string) | |
{ | |
$normalizeChars = array( | |
'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', | |
'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', | |
'Ï'=>'I', 'Ñ'=>'N', 'Ń'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', | |
'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', | |
'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', | |
'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ń'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', |
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
git config --global core.editor "vim" | |
#Run above command in Terminal / git-bash to change git editor from default to "vim" editor |
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 | |
// Provide the Host Information. | |
$vHost = 'gateway.sandbox.push.apple.com'; | |
//$vHost = 'gateway.push.apple.com'; | |
$vPort = 2195; | |
// Provide the Certificate and Key Data. | |
$vCert = 'Certificates.pem'; |
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
//$vHost = 'gateway.sandbox.push.apple.com'; | |
$vHost = 'gateway.push.apple.com'; | |
$vPort = 2195; | |
$vCert = APPPATH.'../assets/certificates/Certificates-Production.pem'; | |
$vPassphrase = 'password to your pem file'; | |
$vToken = $data['token']; | |
$vAlert = array( |
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
$dbname=’db’; //your database name | |
$username=’userrname’; // your database user name | |
$password=’password’; //your database user password | |
$db = mysql_connect($dbname,$username,$password); | |
if (!$db) { | |
echo "Cannot connect to the database – incorrect details"; | |
} else { | |
mysql_select_db(‘pm’); | |
$result = mysql_query(‘show tables’); |
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
remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' ); |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# custom rules for loading server images or any other uploaded media files locally. | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{HTTP_HOST} ^localhost$ | |
RewriteRule ^.*/uploads/(.*)$ http://livesiteurl.com/wp-content/uploads/$1 [L,R=301,NC] | |
# default WordPress rules |
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 tv_change_post_label() | |
{ | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'News'; | |
$submenu['edit.php'][5][0] = 'News'; | |
$submenu['edit.php'][10][0] = 'Add News'; | |
$submenu['edit.php'][16][0] = 'News Tags'; | |
} | |
function tv_change_post_object() |
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 cc_mime_types($mimes) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter('upload_mimes', 'cc_mime_types'); | |
function fix_svg_thumb_display() { | |
echo '<style type="text/css"> | |
td.media-icon img[src$=".svg"], img[src$=".svg"].attachment-post-thumbnail { | |
width: 100% !important; |
OlderNewer