Skip to content

Instantly share code, notes, and snippets.

View miknight's full-sized avatar

Michael Knight miknight

View GitHub Profile
#!/usr/bin/env ruby
require 'rubygems'
require 'prawn'
require 'prawn/layout'
data = [["Gregory","Brown"],["James","Healy"],["Jia","Wu"]]
Prawn::Document.generate("table.pdf") do
table data, :headers => ["First Name", "Last Name"]
% tidy -e test.html
line 28 column 1 - Warning: missing </pre> before <table>
line 43 column 7 - Warning: inserting implicit <pre>
line 51 column 1 - Warning: missing </pre> before <table>
line 78 column 7 - Warning: inserting implicit <pre>
line 91 column 1 - Warning: missing </pre> before <table>
line 128 column 7 - Warning: inserting implicit <pre>
line 171 column 1 - Warning: missing </pre> before <table>
line 206 column 7 - Warning: inserting implicit <pre>
line 217 column 1 - Warning: missing </pre> before <table>
-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx384m
-Xss2m
#!/bin/bash
rsync -avz --exclude pull.sh --exclude push.sh user@server.com:/path/to/folder/ .
date
#!/bin/bash
rsync -auvz --exclude push.sh --exclude pull.sh --exclude .git --exclude css --exclude .css --exclude /inc/js/jqgrid/themes/ --exclude .DS_Store . user@server.com:/path/to/folder/
date
@miknight
miknight / gist:137904
Created June 30, 2009 00:17
~/.vimrc
set nocompatible
syn on
set linebreak
set hlsearch
set bg=dark
set sw=4
set ts=4
set bs=2
set si
set expandtab
#!/bin/bash
# Replaces PHP function calls date_format() with date() and date_create() with strtotime() to maintain PHP 5.1 compatibility.
for file in `grep -Rin date_format * | grep -v '.svn' | grep -v 'convert.sh' | grep -v 'test.php' | cut -d: -f1 | sort -u`; do
echo "Replacing calls in $file";
#ruby -pe 'gsub(/date_format\(date_create\((.+)\), \"(.+)\"\)/, "date(\"\\2\", strtotime(\\1))")' < $file > $file.temp1
ruby -pe 'gsub(/date_create\((.+?)\)/, "strtotime(\\1)")' < $file > $file.temp1
ruby -pe 'gsub(/date_format\((.+?), \"(.+?)\"\)/, "date(\"\\2\", \\1)")' < $file.temp1 > $file.temp2
rm $file.temp1
// MarioRogic, mrog212
// Wed15-Bugle
// 29/07/09
// Lab02: analyse dna sequences
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int getLineCount(FILE * pFile);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[]) {
char *pStrings[2];
pStrings[1] = (char*)malloc(100);
memset(pStrings[1], 0, 100);
pStrings[1][0] = 'c';
<html>
<head>
<title>Label Checkbox Test</title>
</head>
<body>
<form>
<label for="checker">click me</label>
<input type="checkbox" id="checker" />
# Steps to compile Passenger against the MacPorts version of Apache on OS X:
Chewbacca% sudo -s
Chewbacca# export APXS2=/opt/local/apache2/bin/apxs
Chewbacca# passenger-install-apache2-module