Skip to content

Instantly share code, notes, and snippets.

View joglomedia's full-sized avatar
🏠
Working from home

Edi Septriyanto joglomedia

🏠
Working from home
View GitHub Profile
@joglomedia
joglomedia / gist:464b6ca707980fb20ef09e910b194baa
Created October 6, 2016 18:16 — forked from mikejolley/gist:3b37b9cc19a774665f31
Example instance based shipping method
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Sample instance based method.
*/
class WC_Shipping_Test_Method extends WC_Shipping_Method {
@joglomedia
joglomedia / innobackupex-restore.sh
Last active November 21, 2015 06:47 — forked from dalecaru/innobackupex-restore.sh
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/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
@joglomedia
joglomedia / mailwizz.dev.conf (MailWizz Nginx Configuration)
Last active November 9, 2022 22:17
MailWizz Nginx Configuration (Install using Simple LNMP Installer - https://github.com/joglomedia/deploy) - MailWizz EMA is a simple, efficient and full-featured email marketing application with an impressive features set. Download MailWizz here http://goo.gl/qDMd0I
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;
@joglomedia
joglomedia / mautic.dev.conf (Mautic Nginx Configuration)
Last active January 26, 2021 06:16
Mautic Nginx Config (Install using Simple LNMP Installer - https://github.com/joglomedia/deploy) - Open Source Marketing Automation
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;
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
<?php
date_default_timezone_set('UTC');
// Create keys at hhttps://portal.aws.amazon.com/gp/aws/securityCredentials
class AmazonClient {
/** @var cURL */
public $curl;
@joglomedia
joglomedia / yt-upload.py
Created March 1, 2015 13:01
Youtube Upload
#!/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
@joglomedia
joglomedia / ffmpeg_installer
Last active July 30, 2021 00:59
Simple Bash Script to Install FFMPEG + Required Libraries in Ubuntu 14.04
#!/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)
@joglomedia
joglomedia / phalcon-generate-hashed-filename-for-compiled-path
Last active August 29, 2015 14:13
Phalcon: Generate Hashed Filename for Compiled Template Path
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';
}
));
/*
* 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);