Skip to content

Instantly share code, notes, and snippets.

View todiadiyatmo's full-sized avatar

Todi Adiyatmo Wijoyo todiadiyatmo

View GitHub Profile
@todiadiyatmo
todiadiyatmo / gist:536e4e0865824aa60438e20942885829
Created September 18, 2016 19:08
Redis WordPress - Redis as Memcached
stop-writes-on-bgsave-error no
#save 900 1
#save 300 10
#save 60 10000
appendonly no
maxmemory-policy allkeys-lru
angular.element(document.getElementsByClassName('product-card')).scope().$last
angular.element(document.getElementById('product-results-wrapper')).scope().products.data
@todiadiyatmo
todiadiyatmo / synergy.sh
Created September 2, 2016 08:27
synergy multi monitor from linux
#!/bin/bash
killall -9 synergyc
synergyc --daemon --display :0.0 --name T440-1 192.168.1.74
synergyc --daemon --display :0.1 --name T440-2 192.168.1.74
@todiadiyatmo
todiadiyatmo / config.md
Created August 29, 2016 03:39
wp-redis-object-cache
define('WP_REDIS_HOST','127.0.0.1');
//define('WP_REDIS_PASSWORD','authpassword');
define('WP_REDIS_DATABASE',0); // Set to different number for each WP Install
define('WP_REDIS_IGNORED_GROUPS',array('comments','posts','post_meta','counts')); // -> make sure this group not cached
@todiadiyatmo
todiadiyatmo / etc.md
Last active August 21, 2016 02:32
Node JS

PM2

pm2 start xxxx.js --name='xxxx'
pm2 save
@todiadiyatmo
todiadiyatmo / howto.md
Last active December 29, 2016 01:17
Vagrant On Windows

Requirement

  1. Install scoop
  • install sudo openssh rsync
  1. Install Virtualbox 5.0
  • install virtualbox guest addition
  1. Install Vagrant

Vagrant

@todiadiyatmo
todiadiyatmo / filesystem.php
Created August 6, 2016 05:23
WP Filesystem quick usage
$dir = plugin_dir_path( __FILE__ );
global $wp_filesystem;
// Initialize the WP filesystem, no more using 'file-put-contents' function
if (empty($wp_filesystem)) {
require_once (ABSPATH . '/wp-admin/includes/file.php');
WP_Filesystem();
}
@todiadiyatmo
todiadiyatmo / readme.md
Created May 29, 2016 08:46
Delete Slack File older than 30day
@todiadiyatmo
todiadiyatmo / gist:5d6118fbf19a66d64882
Created February 13, 2016 07:39
Screenshoot interval FTW
#! /bin/bash
# http://askubuntu.com/questions/140942/take-a-screenshot-of-webpage-at-intervals
while true; do
shutter --web="http://www.hipwee.com" -e
sleep 5m
done