Skip to content

Instantly share code, notes, and snippets.

Avatar

Mentholiptuz mentholiptuz

  • Bangkok, Thailand
View GitHub Profile
View gist:7434042
#!/bin/sh
# Install OpenERP 7 on Digital Ocean
# Fernando Altuzar
# Modified script from Carlos E. Fonseca Zorrilla & Mario Gielissen
# First: Create a Droplet with CentOS 32 bits
# Then:
yum -y install wget unzip
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
@mentholiptuz
mentholiptuz / Recent Post Shortcode Wordpress
Last active Dec 22, 2015
Add this shortcode to the page where you would like to pull in your recent posts. Shortcode: [recent-posts]
View Recent Post Shortcode Wordpress
function my_recent_posts_shortcode($atts){
$q = new WP_Query(
array( 'orderby' => 'date', 'posts_per_page' => '4')
);
$list = '<ul class="recent-posts">';
while($q->have_posts()) : $q->the_post();
$list .= '<li>' . get_the_date() . '<a href="' . get_permalink() . '">' . get_the_title() . '</a>' . '<br />' . get_the_excerpt() . '</li>';
View gist:5924735
server {
# output compression saves bandwidth
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# make sure gzip does not lose large gzipped js or css files
@mentholiptuz
mentholiptuz / base.conf
Created Jun 9, 2013
nginx.conf + base.conf for ruby on rail
View base.conf
## base.conf
server {
listen 80;
server_name base.com;
rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
}
server {
listen 80 default;
@mentholiptuz
mentholiptuz / installation.sh
Created Jun 9, 2013 — forked from mikhailov/installation.sh
nginx+passenger (real production config)
View installation.sh
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz