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
#!/bin/bash | |
# Install dependencies | |
sudo apt-get install -y apache2-mpm-worker | |
sudo apt-get install -y libapache2-mod-fastcgi php5-fpm | |
# Disable prefork & Enable fcgi | |
sudo a2dismod php5 mpm_prefork | |
sudo a2enmod actions fastcgi alias mpm_worker |
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 | |
class WC_Gateway_EFAREM extends WC_Payment_Gateway | |
{ | |
public function __construct() | |
{ | |
$this->id = 'efarem'; | |
$this->icon = plugin_dir_url(__FILE__) . '/assets/images/efarem.png'; | |
$this->has_fields = true; | |
$this->method_title = '{Title of Gateway}'; |
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 | |
/** | |
* An array of countries with ISO2 codes as key | |
* | |
* @return array | |
**/ | |
function getCountries() | |
{ | |
$options["AF"] = "Afghanistan"; |
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
./configure --prefix=/usr/local/src/php-5.4.23 --with-config-file-path=/usr/local/src/php-5.4.23/lib/php.ini --enable-cgi --enable-soap --with-pdo-mysql --with-curl --with-mysql --with-openssl --enable-force-cgi-redirect |
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/local/psa/bin/php_handler --add -id "5.4.23" -displayname "5.4.23" -path /usr/local/src/php-5.4.23/bin/php -phpini /usr/local/src/php-5.4.23/lib/php.ini -type "fastcgi" |
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 | |
/** | |
* Are we on a blog page? | |
* | |
* @return bool | |
**/ | |
function is_blog() | |
{ | |
return (is_post_type_archive('post') || is_author() || is_category() || is_home() || is_singular('post') || is_tag()) ? true : false ; |
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
if (!isset($_SERVER['HTTPS'])) | |
{ | |
header('Status-Code: 301'); | |
header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); | |
} | |
else | |
{ | |
header('Strict-Transport-Security: max-age=500'); | |
} |
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 processImage($imgname) | |
{ | |
// Load original image | |
$original = @imagecreatefromjpeg($imgname); | |
if (!$original) | |
die('Bad Image: ' . $imgname); |
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 | |
/** | |
* Convert a timestamp into a relative string e.g. 2 Hours ago | |
* | |
* @return string | |
* | |
* @param $time Timestamp | |
**/ | |
function time_elapsed($time) |
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 | |
if (!class_exists('FRM_Loop')) | |
{ | |
class FRM_Loop | |
{ | |
public function __construct() | |
{ | |
add_shortcode('loop', array(&$this, 'loop_shortcode')); | |
} |
NewerOlder