Skip to content

Instantly share code, notes, and snippets.

@nghuuphuoc
nghuuphuoc / gist:7876037
Last active December 30, 2015 19:39
Install Memcached on Centos 6
$ yum install memcached
// Configure Memcached
$ nano -w /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS=""
@nghuuphuoc
nghuuphuoc / gist:7886804
Last active December 30, 2015 21:19
Nginx config for Wordpress Super Cache plugin
server {
set $supercache_file '';
set $supercache_uri $request_uri;
if ($request_method = POST) {
set $supercache_uri '';
}
# Using pretty permalinks, so bypass the cache for any query string
if ($query_string) {
@nghuuphuoc
nghuuphuoc / gist:7904221
Last active December 30, 2015 23:59
Allow Wordpress to update the plugin without asking for FTP account
// Add the following line to wp-config.php
define('FS_METHOD','direct');
// Set wp-content permission
$ chmod -R 775 wp-content/
$ chown -R nginx:nginx wp-content/
@nghuuphuoc
nghuuphuoc / gist:8311022
Created January 8, 2014 02:55
Remove .svn files recursively
$ find . -name .svn -exec rm -rf {} \;
@nghuuphuoc
nghuuphuoc / gist:7884897
Last active February 19, 2016 16:57
Configure Nginx for Wordpress
server {
listen 80;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
@nghuuphuoc
nghuuphuoc / package.json
Created July 21, 2016 04:33 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js'",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@nghuuphuoc
nghuuphuoc / gist:7884874
Last active March 2, 2017 08:11
Some of useful Nginx rewrite rules
// Nginx redirect non-www to www
server {
listen 80;
server_name domain.com;
rewrite ^/(.*)$ http://www.domain.com/$1 permanent;
}
server {
listen 80;
server_name www.domain.com;
@nghuuphuoc
nghuuphuoc / gist:8331575
Created January 9, 2014 09:22
chmod files to 644 and all folders to 755
$ find . -type d -print0 | xargs -0 chmod 0775
$ find . -type f -print0 | xargs -0 chmod 0664
@nghuuphuoc
nghuuphuoc / codegolf.md
Created October 15, 2017 09:15 — forked from xem/codegolf.md
JS code golfing

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)