Skip to content

Instantly share code, notes, and snippets.

View ivankristianto's full-sized avatar

Ivan Kristianto ivankristianto

View GitHub Profile
@ivankristianto
ivankristianto / archdel.zshrc
Created February 23, 2017 02:54
Archive Git Branch
arcdel() {
if [ -z $1 ]; then
echo "Error: missing branch name"
else
git checkout $1
git pull origin $1
git tag archive/$1
git push origin archive/$1
git checkout master
git push origin --delete $1
@ivankristianto
ivankristianto / elasticsearch-docker.sh
Created February 8, 2017 13:43
Run Elasticsearch on Docker
docker run -d --rm --name es -p 9200:9200 -p 9300:9300 elasticsearch:5.2.0
@ivankristianto
ivankristianto / phpbench.txt
Created January 19, 2017 06:10
PHP Benchmark
http://www.phpbench.com/
@ivankristianto
ivankristianto / iterm2-solarized.md
Created January 15, 2017 06:19 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@ivankristianto
ivankristianto / ivan.json
Created January 15, 2017 06:18
tmux profile
{
"Ansi 5 Color" : {
"Green Component" : 0.1080246344208717,
"Blue Component" : 0.4351663589477539,
"Red Component" : 0.7773894071578979
},
"Tags" : [
],
"Ansi 12 Color" : {

How-To: Install Memcache on CentOS (WHM/cPanel)

Without wasting much time, Let us get started!

Follow these simple instructions:

  • Step 1: Login into your WHM panel and using easyapache enable Memcache

  • Step 2: SSH into your server and fire this command yum install memcached.x86_64 php-pecl-memcache.x86_64

@ivankristianto
ivankristianto / wp_mail_smtp.txt
Created December 14, 2016 00:18
wp_mail() log error and smtp setting
add_action('wp_mail_failed', 'log_mailer_errors', 10, 1);
function log_mailer_errors($mailer){
$fn = ABB_FRAMEWORK . 'mail.log'; // say you've got a mail.log file in your server root
$fp = fopen($fn, 'a');
fputs($fp, "Mailer Error: " . json_encode($mailer->get_error_messages()) ."\n");
fclose($fp);
}
add_action( 'phpmailer_init', 'mailer_config', 10, 1);
function mailer_config(PHPMailer $mailer){
@ivankristianto
ivankristianto / delete_bash_history.sh
Created October 19, 2016 02:10
Delete history bash
cat /dev/null > ~/.bash_history && history -c && exit
@ivankristianto
ivankristianto / email-template.html
Created September 2, 2016 07:59
Email Template Idaff
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style>
body{margin: 0;padding: 0;position: relative;background: #eeeeee}
p{margin-bottom: 10px;}
</style>
</head>
@ivankristianto
ivankristianto / php5apache-with-memcache.txt
Created June 19, 2016 15:14
Install memcached php7 on docker
FROM php:7.0-fpm
# ...
RUN apt-get update && apt-get install -y \
libpq-dev \
libmemcached-dev \
curl
# ...