Skip to content

Instantly share code, notes, and snippets.

View manhg's full-sized avatar

Jan manhg

  • Tokyo, Japan
View GitHub Profile
certbot --nginx --non-interactive --quiet --post-hook "systemctl reload nginx" renew
@manhg
manhg / cache.conf
Last active August 15, 2018 08:29
Caching based on MIME type
expires $mime_cache_time;
add_header "Cache-Control" $cacheable;
location ~ \.(css|js|jpg|png|gif|pdf)$ {
log_not_found off;
access_log off;
}
https://github.com/twolfson/sublime-hooks
on_post_save_async
https://www.sublimetext.com/docs/3/api_reference.html#sublime_plugin.EventListener
http://docs.sublimetext.info/en/latest/file_processing/build_systems.html
npm config set loglevel error
# Linux server <--> macOS client
# ----- Linux
apt-get install nfs-kernel-server
# /etc/exports
# macOS likes insecure
/srv/nfs 192.168.64.0/24(rw,async,no_subtree_check,all_squash,anonuid=501,anongid=501,insecure)
exportfs -rav
@manhg
manhg / calendar.tag.html
Created November 21, 2017 07:54
RiotJS calendar tag (tested with riot 2.3)
<!-- thanks to initial source code: http://cognitom.github.io/riot-bootstrap/ -->
<calendar>
<table>
<thead>
<tr>
<th><btn onclick={ prev }>◁</btn></th>
<th colspan="5">{ title }</th>
<th><btn onclick={ next }>▷</btn></th>
</tr>
</thead>
bind = '127.0.0.1:9300'
proc_name = 'app'
backlog = 2048
preload_app = True
workers = 8
worker_class = 'gevent' # 'sync'
worker_connections = 1000
timeout = 30
keepalive = 2
@manhg
manhg / gist:490231810d64b262555ffc11c7430585
Created October 11, 2017 02:12
nginx development bind domain to port
server {
resolver 127.0.0.1;
listen 80;
server_name "~^(?P<app_group>\w+)?(?:\.)?(?P<app_name>\w+)-(?P<app_port>\d{4})\.devel$";
root /work/$app_name/public;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:$app_port;
proxy_redirect http://localhost:$app_port/ /;
https://www.sitepoint.com/create-calendar-icon-html5-css3/