Skip to content

Instantly share code, notes, and snippets.

@ivanoats
ivanoats / Rakefile
Created March 13, 2011 20:42
Rakefile for WordPress and Joomla project deployment from localhost to remote
# Copyright 2011 Ivan Storck
# Rakefile to manage automated local / remote sync of PHP projects like WordPress and Joomla
# Assumptions:
# Git is the version control system
# Only tested with ssh shortcuts in .ssh/config and public keys but should work with username and password too
# for WordPress , .gitignore ignores wp-config.php
# for Joomla, .gitignore ignores configuration.php
require 'rake'
require 'net/ssh'
@dongilbert
dongilbert / wp-shell-install.sh
Created May 2, 2011 15:27
Auto Install Latest WordPress from Shell
#!/bin/bash
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert
# Disclaimer: It might not bloody work
# Disclaimer 2: I'm not responsible for any screwups ... :)
# DB Variables
echo "MySQL Host:"
read mysqlhost
export mysqlhost
@tomislav
tomislav / deploy.rb
Created July 13, 2011 13:12
Capistrano recipe for Wordpress
default_run_options[:pty] = true
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
require 'capistrano'
require 'rubygems'
require 'railsless-deploy'
set :application, "vault42.org"
set :deploy_to, "/usr/local/www/#{application}"
set :backup_dir, "/home/tomislav/backup"
set :use_sudo, false
@kazu69
kazu69 / pjax.rb
Created March 13, 2012 16:34
Pjax(pushState + Ajax) with Sinatra and BackboneJs
#encoding: UTF-8
require 'rubygems'
require 'sinatra'
require 'erb'
require 'pp'
class Sinatra::Request
def pjax?
env['HTTP_X_PJAX'] || self['_pjax']
@stammy
stammy / hack.sh
Created April 1, 2012 09:55 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@brookr
brookr / config.ru
Created April 16, 2012 04:36
Rackup file I use for running WordPress on Pow
# config.ru for Pow + Wordpress, based on http://stuff-things.net/2011/05/16/legacy-development-with-pow/
# added hackery to work around wordpress issues - Patrick Anderson (patrick@trinity-ai.com)
# clearly this could be cleaner, but it does work
require 'rack'
require 'rack-legacy'
require 'rack-rewrite'
# patch Php from rack-legacy to substitute the original request so
# WP's redirect_canonical doesn't do an infinite redirect of /
@pztrick
pztrick / fancyimage_tag.rb
Created June 21, 2012 01:33
Jekyll Image plugin that dynamically creates thumbnails and fancyboxes for uploaded images
# Title: Fancyimage tag for Jekyll
# Authors: Devin Weaver (photos_tag.rb), Brian M. Clapper (img_popup.rb), Patrick Paul (this gist)
# Description: Takes full size image, automagically creates thumbnail at specified size, +fancybox
#
# Adapted from:
# http://tritarget.org/blog/2012/05/07/integrating-photos-into-octopress-using-fancybox-and-plugin/
# (photos_tag.rb) https://gist.github.com/2631877
# (img_popup.rb) https://github.com/bmc/octopress-plugins/
#
# Syntax {% photo filename [tumbnail] [title] %}
@sandys
sandys / etc_sites_enabled_default.nginx
Created September 4, 2012 06:40
Bulletproof Wordpress installation
proxy_cache_path /var/lib/nginx/cache/staticfiles levels=1:2 keys_zone=staticfilecache:60m inactive=90m max_size=50m;
proxy_temp_path /var/lib/nginx/proxy;
proxy_connect_timeout 30;
proxy_read_timeout 120;
proxy_send_timeout 120;
map $http_cookie $logged_in {
default 0;
~wordpress_logged_in 1; # Wordpress session cookie
@juliendsv
juliendsv / gist:3737284
Created September 17, 2012 13:32
Speedup mysql by using RAMDISK
#!/bin/bash
sudo mkdir /db/tmpfs
sudo mount -osize=256m tmpfs /db/tmpfs -t tmpfs
sudo chmod 777 /db/tmpfs
# IMPORTANT edit your /etc/apparmor.d/usr.sbin.mysqld
# to match your new path
# so /var/lib/mysql -> /db/tmpfs/mysql/ (there must be 2 links)
# Then restart apparmor /etc/init.d/apparmor restart
@mbbx6spp
mbbx6spp / install_percona.sh
Created October 10, 2012 17:07
Percona Server 5.5 unattended install on Ubuntu 11.10 (oneiric)
#!/usr/bin/env bash
PERCONA_PW=$1
DEBCONF_PREFIX="percona-server-server-5.5 percona-server-server"
[ ! $# -eq 1 ] && echo "Usage: $0 PASSWORD" && exit 1;
gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
gpg -a --export CD2EFD2A | sudo apt-key add -
sudo sh -c 'cat <<EOF >/etc/apt/sources.list.d/percona.list