Skip to content

Instantly share code, notes, and snippets.

View pcdinh's full-sized avatar

Pham Cong Dinh pcdinh

View GitHub Profile
#!/usr/bin/env php
<?php
if( ! function_exists( 'inotify_init' ) ) {
die_with_error( 'This script needs the inotify module' );
}
// usage: $0 path [path ...] -- command
$args = $_SERVER['argv'];
// create list of unused stylesheet rules
$(document).ready(function()
{
var sel = [];
for( var s = 0 ; s < document.styleSheets.length ; s++ ) {
var rules = document.styleSheets[s].cssRules || document.styleSheets[s].rules;
for( var r = 0 ; r < rules.length ; r++ ) {
# php 5.3 snow leopard
# need 64 bit mysql as /usr/local/mysql
# compile apache
./configure --enable-layout=Darwin --enable-mods-shared=all
make
sudo make install
# now configure php. then make; sudo make install
CFLAGS="-arch x86_64" \
./configure \
--with-apxs2=/usr/sbin/apxs --prefix=/usr/local/php5.2.8 --with-config-file-scan-dir=/usr/local/php5.2.8/php.d \
--with-config-file-path=/usr/local/php5.2.8/php.d \
--disable-posix \
--enable-cli \
--with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-jpeg-dir=/opt/local/include --with-png-dir=/opt/local/include --enable-gd-native-ttf --with-freetype-dir=/usr/local/php5.2.8 \
--with-zlib \
--enable-pdo --with-pdo-sqlite --with-sqlite=shared --enable-sqlite-utf8 \
var Iamstef = Iamstef || {};
(function(lib){
var url = document.URL,
api = {};
api.path = function(regex,fcn){
var result = url.match(regex);
if(result){
fcn(result);
@pcdinh
pcdinh / utils.js
Created December 9, 2009 09:34 — forked from bavardage/utils.js
function randomColor() {
var color = (0xffffff * Math.random()).toString(16);
return "#" + color.replace(/\./i,"").slice(0,6);
};
function fallbackFor(arg, fallback) {
return (typeof arg !== 'undefined') ? arg : fallback;
}
function require(arg, name) {
// collapse table sections
$(document).ready(function() {
$('tbody:has(th)').addClass('collapse')
.find('tr:first-child th')
.wrapInner('<a href="#"></a>')
.find('a')
.click(function() {
var $thisLink = $(this);
$thisLink
#!/bin/bash
# --- Version history ---
# 0.4: added variable to store file path, and $2 for base file name
# added variable to store desired reporting interval
# 0.3: added $1 to send in process ID at run time.
# 0.2: switched to $SECONDS for the loop. works.
# 0.1: didn't work well at all.
# --- Version history ---
# Usage: cputrack [PID] [filename]
sb = Sebastian Bergmann <sb@sebastian-bergmann.de>
dotxp = Tobias Schlitt <tobias@schlitt.info>
mlively = Michael Lively Jr. <mjlivelyjr@gmail.com>
lewismic = Mike Lewis <lewismic@grinnell.edu>
/* `Rounded Corners
----------------------------------------------------------------------------------------------------*/
.round_all {
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.round_top {