Skip to content

Instantly share code, notes, and snippets.

@joequery
joequery / simpletree.html
Created August 21, 2011 06:14
An implementation of SimpleTree
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery-simpleTreeMenu-1.1.0.js"></script>
<script>
$(document).ready(function() {
var x=0;
var u=0;
var ulidp="";
var ulidc="";
@joequery
joequery / gist:1160252
Created August 21, 2011 06:32
"Toggling" Tables
<html>
<head>
<title></title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style type="text/css">
.hideme {display: none;}
</style>
</head>
<body>
<table id="mainTable" border="1">
@joequery
joequery / gist:1160286
Created August 21, 2011 07:22
jLayout Implementation
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jLayout Examples</title>
@joequery
joequery / nginx.conf
Created January 13, 2012 14:51
Nginx server configuration for use with Unicorn
worker_processes 1;
user nobody nogroup;
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024;
accept_mutex off;
}
http {
default_type application/octet-stream;
@joequery
joequery / gist:1607063
Created January 13, 2012 15:49
Convient bash functions for managing nginx and Unicorn
# Kill and restart nginx
function restart_nginx(){
pids=$(pidof nginx)
if [[ -n $pids ]];
then
sudo kill -9 $pids
sudo service nginx restart
fi
}
@joequery
joequery / gist:1635318
Created January 18, 2012 20:23
Nginx config for use with multiple rails apps
worker_processes 1;
user nobody nogroup;
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024;
accept_mutex off;
}
http {
default_type application/octet-stream;
@joequery
joequery / gist:1640945
Created January 19, 2012 16:19
Nginx individual site config for multiple rails apps with Unicorn
##############################################################
# Upstream must have unique name and unique socket. #
# The socket must match what is in the app's unicorn.rb file #
##############################################################
upstream railsapp1_server {
server unix:/tmp/railsapp1.sock fail_timeout=0;
}
##############################
# Rewrite www to non-www #
@joequery
joequery / gist:1670769
Created January 24, 2012 15:45
Install git-dude on OSX

This is a small instruction guide for installing git-dude on OSX. Git dude is a convenient git repo monitoring service.

Ensure you have Homebrew installed.


Install growlnotify via brew install growlnotify.

If you are a Lion user and are getting No formula available, then you can just download growlnotify as a package

@joequery
joequery / gist:1695043
Created January 28, 2012 17:06
Ruby Assignment Returns
1.9.2-p290 :001 > def mytest
1.9.2-p290 :002?> return @someval = 10
1.9.2-p290 :003?> end
=> nil
1.9.2-p290 :004 > mytest
=> 10
1.9.2-p290 :005 > @someval
=> 10
1.9.2-p290 :006 > def mytest2
1.9.2-p290 :007?> return @someval ||= 30
@joequery
joequery / gist:1807167
Created February 12, 2012 08:01
Install Nginx and PHP5-FPM
# Add a necessary repository.
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:brianmercer/php
sudo apt-get update
sudo apt-get install nginx
sudo apt-get install php5-cli php5-common php5-mysql php5-suhosin php5-gd php5-dev
sudo apt-get install php5-fpm php5-cgi php-pear php5-memcache php-apc