Skip to content

Instantly share code, notes, and snippets.

View chales's full-sized avatar

Chris Hales chales

View GitHub Profile
@rafi
rafi / post-receive
Created March 25, 2010 19:34
Deploying with Git
mkdir ~/git/website.git && ~/git/cd website.git
git init --bare
mkdir ~/webapps/website
git config core.bare false
git config core.worktree /home/rafi/webapps/website ; NO TRAILING SLASH!!! Will screw up things real bad.
git config receive.denycurrentbranch ignore
; create a hook
cat > hooks/post-receive
#!/bin/sh
@mostalive
mostalive / default.vcl
Created December 17, 2010 07:57
varnish cache server configuration file, used with drupal 6 and apache
#varnish cache server configuration file, used with drupal 6 and apache
#inspiration from https://wiki.fourkitchens.com/display/PF/Configure+Varnish+for+Pressflow
#with change from obj to beresp of
#http://www.mail-archive.com/varnish-misc@projects.linpro.no/msg02911.html
#and cache HIT or MISS header from somewhere else
backend default {
.host = "127.0.0.1";
.port = "80";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
@badsyntax
badsyntax / build.sh
Created January 11, 2011 20:56
An example PHP & BASH Post-Receive github web hook to package projects
#! /usr/bin/env bash
#clone the repo
git clone -q "${1}" "clones/${2}"
cd "clones/${2}"
#update the submodules (how do we handle errors here?)
git submodule --quiet update --init --recursive
@petemcw
petemcw / default.vcl
Created May 22, 2011 02:20
Lullabot's Custom Varnish VCL File
#
# Customized VCL file for serving up a Drupal site with multiple back-ends.
#
# For more information on this VCL, visit the Lullabot article:
# http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal
#
# Define the internal network subnet.
# These are used below to allow internal access to certain files while not
# allowing access from the public internet.
@proofek
proofek / pre-receive
Created June 2, 2011 14:21
pre-receive git hook to run php linter
#!/usr/bin/php
<?php
echo "\nRunning php linter...\n";
$params = explode(' ', file_get_contents('php://stdin'));
$ref = trim($params[1]);
$diff = array();
$return = 0;
@aliang
aliang / Mac SSH Autocomplete
Created June 14, 2011 07:14
Add auto complete to your ssh, put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@jcjc
jcjc / gist:1225976
Created September 19, 2011 04:46
Sample Selenium-WebDriver tests
public void ShareSpecialCharTest() {
login(g_userDataMap.get(Constants.DEFAULT_USER));
g_nav.clickLeftButton();
String shareBody = Util.currentTime() + " " + TestData.SHARE_SPECIAL_CHAR;
HomeTest.verifyShareOnRecentActivity(driver, g_nav, shareBody);
}
@macek
macek / pear-lion-install.md
Created October 20, 2011 16:03
PEAR on OS X Lion

After upgrading to OSX Lion, I discovered that both PEAR and PECL had gone missing. It turns out that you have to re-install them, but luckily it's quite simple. I found this quick guide from Ruggero De Pellegrini on Google+, and thought I would share the info to save you the confusion:

  1. Download the installer curl http://pear.php.net/go-pear.phar > go-pear.php
  2. Start the installation procedure with sudo sudo php -q go-pear.php
  3. Select a new installation base ($prefix) e.g. /usr/local
  4. Proceed with the install.
  5. If there is no /etc/php.ini file yet, copy the default sudo cp /etc/php.ini.default /etc/php.ini
  6. Edit /etc/php.ini and change the line ;include_path = ".:/php/includes" to include_path = ".:/usr/local/share/pear"
  7. Add /usr/local/bin/ to your path if you haven't already, e.g. in .profile
@smithcommajoseph
smithcommajoseph / feature_server.profile
Created November 2, 2011 16:35
D6 feature server Drush makefile + install profile
<?php
/**
* Return a description of the profile for the initial installation screen.
*
* @return
* An array with keys 'name' and 'description' describing this profile.
*/
function feature_server_profile_details() {
return array(
# Cookbook Name:: mongodb
# Recipe:: default
case node['platform']
when "ubuntu"
execute "apt-get update" do
action :nothing
end
execute "add gpg key" do