Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Setup PHP
sudo mv /usr/local/php5 ~/Desktop/php5_old
curl -O http://www2.entropy.ch/download/php5-5.2.5-6-beta.tar.gz
tar -xzf php5-*-beta.tar.gz
sudo mv php5 /usr/local/
sudo ln -sf /usr/local/php5/entropy-php.conf /etc/apache2/other/+entropy-php.conf
# Basic Apache config for Textpattern
<txp:php>
// <?
// build a list of file categories
$rs = safe_query('select distinct category
from ' . safe_pfx('txp_file') . '
order by category asc', 1);
if ($rs)
{
while ($row = mysql_fetch_array($rs, MYSQL_NUM))
{
#!/usr/bin/env python
"""
A poor man's directory tree for systems without the `tree` command.
:Author: Jon-Michael Deldin <dev@jmdeldin.com>
:Date: 2009-03-19 19:03 -0600
"""
import sys
@jmdeldin
jmdeldin / fix-title-bar.patch
Created July 23, 2011 10:10
Fix Emacs title bar
diff --git a/src/ChangeLog b/src/ChangeLog
index 37cd344..c121bfb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-11 Bob Halley <rthalley@gmail.com>
+
+ * nsterm.m (initFrameFromEmacs): In OS X 10.7, a title bar
+ is no longer implied by NSResizableWindowMask and must be
+ requested with NSTitledWindowMask.
@jmdeldin
jmdeldin / background.sh
Created March 24, 2012 20:18 — forked from paulitex/background.sh
Mac OS X-compatible GDB script (requires dup2 and open to be cast)
# This all assumes you have the process running in
# a terminal screen and you're on Linux-like system.
# First off, suspend the process and background it
ctrl-z # suspend the process
bg # restart/continue the process in the background
# Now create files to log to. They can be called anything,
# Personally I would end the in .log. E.g. could be
# /var/logs/myprocess-stdout.log,
@jmdeldin
jmdeldin / README.md
Created March 24, 2012 20:28
dupx for OS X 10.7.3

dupx is a shell script to redirect an existing process STDOUT or STDIN to a file. Unfortunately, I was getting this error after invoking dupx -o /tmp/some.log PID:

/tmp/gdbcmd.F8Qf:5: Error in sourced command file:
Unable to call function "dup2" at 0x7fff96e233b8: no return type information available.
To call this function anyway, you can cast the return type explicitly (e.g. 'print (float) fabs (3.0)')
Success

I found a handy Gist that did mostly what dupx does, toyed with it in GDB, and then modified the original dupx script to add (int) type casting in the open, dup, dup2, close, and write calls.

Usage

@jmdeldin
jmdeldin / 100000_r.txt
Created May 24, 2012 05:37
Set of `seq 0 N | sort -rn` text files
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
@jmdeldin
jmdeldin / gist:2890528
Created June 7, 2012 18:14
~/.fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="rgba" mode="assign">
<const>rgb</const>
</edit>
</match>
<match target="font">
<edit name="hintstyle" mode="assign">
source :rubygems
gem 'sinatra'
gem 'shotgun', :group => :development