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 ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
/** | |
* Sample instance based method. | |
*/ | |
class WC_Shipping_Test_Method extends WC_Shipping_Method { |
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/sh | |
# | |
# Script to prepare and restore full and incremental backups created with innobackupex-runner. | |
# | |
# This script is provided as-is; no liability can be accepted for use. | |
# | |
# UPDATE: 21/11/2015 | |
INNOBACKUPEX=innobackupex | |
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX |
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
server { | |
listen 80; | |
#listen [::]:80 default_server ipv6only=on; | |
## Make site accessible from world web. | |
server_name mailwizz.dev www.mailwizz.dev; | |
## Log Settings. | |
access_log /var/log/nginx/mailwizz.dev_access.log; | |
error_log /var/log/nginx/mailwizz.dev_error.log error; |
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
server { | |
listen 80; | |
#listen [::]:80 default_server ipv6only=on; | |
## Make site accessible from world web. | |
server_name mautic.dev www.mautic.dev *.mautic.dev; | |
## Log Settings. | |
access_log /var/log/nginx/mautic.dev_access.log; | |
error_log /var/log/nginx/mautic.dev_error.log error; |
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
server { | |
# see: http://wiki.nginx.org/Pitfalls | |
# see: http://wiki.nginx.org/IfIsEvil | |
listen 80; | |
root /app; | |
index index.html index.htm index.php; | |
error_page 404 /index.php; | |
# Make site accessible from http://set-ip-address.xip.io |
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 | |
date_default_timezone_set('UTC'); | |
// Create keys at hhttps://portal.aws.amazon.com/gp/aws/securityCredentials | |
class AmazonClient { | |
/** @var cURL */ | |
public $curl; |
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/bin/python2 | |
# | |
# Youtube-upload is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# Youtube-upload is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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 | |
# Bash Script to Install FFMPEG in Ubuntu 14.04 | |
# Ref: http://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu | |
# Opsional: install exiftool: apt-get install libimage-exiftool-perl | |
# | |
# Author: Edi Septriyanto http://masedi.net <hi@masedi.net> | |
######################################################################## | |
CURDIR=$(pwd) |
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
closure to generate hashed filename for Phalcon template compiled path kind of file: | |
```php | |
<?php | |
$volt->setOptions(array( | |
'compiledPath' => function($templatePath) { | |
return md5($templatePath) . '.php'; | |
} | |
)); |
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
/* | |
* Display Image from the_post_thumbnail or the first image of a post else display a default Image | |
* Chose the size from "thumbnail", "medium", "large", "full" or your own defined size using filters. | |
* USAGE: <?php echo my_image_display(); ?> | |
*/ | |
function my_image_display($size = 'full') { | |
if (has_post_thumbnail()) { | |
$image_id = get_post_thumbnail_id(); | |
$image_url = wp_get_attachment_image_src($image_id, $size); |