Skip to content

Instantly share code, notes, and snippets.

View nathancarnes's full-sized avatar

Nathan Carnes nathancarnes

View GitHub Profile
@apolloclark
apolloclark / postgres cheatsheet.md
Last active April 25, 2025 20:57
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@nathancarnes
nathancarnes / gist:3948871
Created October 24, 2012 21:04
Install nokogiri 1.4.4
gem install nokogiri -v=1.4.4 -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
@scottkellum
scottkellum / normalized.html
Created December 6, 2011 14:58
pixel normalization
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>
@amiel
amiel / README.md
Created October 28, 2011 19:08
post-commit git hook for simple deploys

Put the ruby file in .git/hooks/post-commit

Create a deploy script as .deploy_*

Example:

# File: .deploy_production
scp -R html example.com:public_html

Then use "deploy *" in your commit message.

@ungoldman
ungoldman / example.html
Created October 24, 2011 23:02
ga click tracking w/ data attributes
<!DOCTYPE HTML>
<html lang='en-US'>
<head>
<meta charset='UTF-8'>
<title></title>
</head>
<body>
<a data-ga='play' data-context='game'>Play</a>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
@amiel
amiel / .gitignore
Created November 15, 2010 18:38 — forked from redoPop/.gitignore
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
new snow leopard install process for homebrew and rvm:
textmate, chrome
ssh-keygen -t rsa
homebrew
Xcode
brew install git
install rvm (http://rvm.beginrescueend.com/rvm/install/)
rvm install ruby-1.8.7
rvm use ruby