Skip to content

Instantly share code, notes, and snippets.

View todiadiyatmo's full-sized avatar

Todi Adiyatmo Wijoyo todiadiyatmo

View GitHub Profile
@todiadiyatmo
todiadiyatmo / Catatan.md
Created June 22, 2017 13:38
Hitung Jarak Long Lat Range Query
set @meterR = 111195;
set @range = 2300 / @meterR;

select id,( st_distance(shape,point(-7.747347,110.404036)) * @meterR  ) as distance from locations 
where st_distance(shape,point(-7.747347,110.404036)) < @range
and locationable_type = 'App\\Models\\Perawat'
@todiadiyatmo
todiadiyatmo / .gitignore
Last active May 28, 2018 01:52
Git Ignore WordPress
*.log
*.zip
*.wpress
*.tar.gz
*.rar
*.tar
wp-config.php
/.htaccess
/license.txt
/readme.html
@todiadiyatmo
todiadiyatmo / ads.html
Last active March 27, 2017 13:45
gist ads
<html><head></head><body><div id="htmlscript">
<a href="http://www.pu.edu.pk/" target="_blank">
<img style="width: 100%;height: auto;" src="http://stagging-adserver.hipwee.com/images/1_ca.jpeg?1490622262"></a>
</div></body></html>
@todiadiyatmo
todiadiyatmo / wp_cron.md
Created March 27, 2017 05:39
WP Cron Disable

wp-config.php

define('DISABLE_WP_CRON', 'true');

Crontab

*/2 * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron  >/dev/null 2>&1
@todiadiyatmo
todiadiyatmo / command.md
Last active March 16, 2017 12:56
cli search replace

PHP Replace

php srdb.cli.php  -h localhost -u [user] -s "[search]" -n [db_name] -r "[replace]" -p "[password]"

Redis stat

/usr/local/rvm/gems/ruby-2.3.0/bin/redis-stat --server --daemon --auth=[]

Search String

- nodemodules/nunjucks/bin ( precompile )
- specify the the source directory and destination file
- precompile templates\items > templates\showitem.js
@todiadiyatmo
todiadiyatmo / wp proxy.md
Created December 27, 2016 08:25
wp proxy.md
define('WP_PROXY_HOST', '10.7.1.7');
define('WP_PROXY_PORT', '8080');
define('WP_PROXY_USERNAME', '');
define('WP_PROXY_PASSWORD', '');
define('WP_PROXY_BYPASS_HOSTS', 'localhost');
@todiadiyatmo
todiadiyatmo / w3tc.md
Created December 19, 2016 06:53
w3tc htaccess
# BEGIN W3TC Browser Cache
<IfModule mod_mime.c>
    AddType text/css .css
    AddType text/x-component .htc
    AddType application/x-javascript .js
    AddType application/javascript .js2
    AddType text/javascript .js3
    AddType text/x-js .js4
    AddType video/asf .asf .asx .wax .wmv .wmx
@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