Skip to content

Instantly share code, notes, and snippets.

View lantrix's full-sized avatar
:octocat:
always coding and merging

Ted B lantrix

:octocat:
always coding and merging
View GitHub Profile
@lantrix
lantrix / .bashrc.sh
Created November 27, 2009 06:28 — forked from tekkub/.bashrc
Git branch name in Bash Prompt showing user@host:path(git_branch) - for xterm-color
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$(parse_git_branch) "
case `id -u` in
0) PS1="${PS1}# ";;
*) PS1="${PS1}$ ";;
esac
#Git bash completion
git_completion_script=$HOME/devel_projects/git/contrib/completion/git-completion.bash
if test -f $git_completion_script; then
source $git_completion_script
fi
NameVirtualHost *
<virtualhost *>
DocumentRoot "/Users/lantrix/devel_projects/vhosts/site.local"
ServerName site.local
ServerAlias http://www.site.local
DirectoryIndex index.php index.html
</virtualhost>
<directory "/Users/lantrix/devel_projects/vhosts/site.local">
AllowOverride All
Options -Indexes +FollowSymLinks
@lantrix
lantrix / gist:635607
Created October 20, 2010 01:51
Compile readline 5 as 64bit on Leopard
tar zxvf readline-5.2.tar.gz
cd readline-5.2
export MACOSX_DEPLOYMENT_TARGET=10.5
export CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp"
export CCFLAGS="-arch x86_64 -g -Os -pipe"
export CXXFLAGS="-arch x86_64 -g -Os -pipe"
export LDFLAGS="-arch x86_64 -bind_at_load"
./configure --prefix=/usr/local
cd shlib
sed -e 's/-dynamic/-dynamiclib/' Makefile > Makefile.good
#Mac OS X 10.x - PostgreSQL/PHP
##Install Mac OSX Developer tools##
##Backup old Postgresql##
pg_dumpall > ~/Documents/dumps/dumpfile
pg_ctl stop
##Compile Postgresql 8.3.14##
(Copied and modified from v8.3 & v8.4 user comments and tested on OS X 10.6.4)
http://www.postgresql.org/docs/8.3/interactive/postgres-user.html
Mac OS X users:
Because OS X uses Open Directory to manage user accounts, there is no useradd/adduser command to speak of.
Instead, one may use a directory services utility to add a new user. This utility varies depending on your OS X version.
OS X 10.0–10.4:
Use the NetInfo Manager.app in /Applications/Utilities
@lantrix
lantrix / delicious_backup.sh
Created December 21, 2010 08:20
How to download an XML copy of your delicious bookmark data
#!/bin/bash
wget \
--http-user=username \
--http-password=password \
--no-check-certificate \
-O delicious.xml \
api.del.icio.us/v1/posts/all
@lantrix
lantrix / IMStatus.scpt
Created January 3, 2011 12:55
Applescript to tell Adium, Skype and iChat to change their status simultaneously
-- IMStatus
-- version 2.0, Lantrix (http://techdebug.com)
-- idea conceived from script by Jason Kenison "theWebGuy" Blog at:
-- http://www.jasonkenison.com/blog.html?id=22
(*
Copyright (c) 2008, TechDebug.com
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@lantrix
lantrix / wp_homefix.patch
Created February 4, 2011 02:55
How to hardcode the Dynamic Home menu item in a Wordpress network install to your top level domain (first installation)
--- wp-includes/post-template.php 2010-12-31 07:45:18.000000000 +0000
+++ wp-includes/post-template.php.fixhome 2011-02-04 02:30:54.000000000 +0000
@@ -842,7 +842,7 @@
$class = '';
if ( is_front_page() && !is_paged() )
$class = 'class="current_page_item"';
- $menu .= '<li ' . $class . '><a href="' . home_url( '/' ) . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
+ $menu .= '<li ' . $class . '><a href="http://yourtoplevelurl.com" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
// If the front page is a page, add it to the exclude list
if (get_option('show_on_front') == 'page') {
@lantrix
lantrix / gist:815884
Created February 8, 2011 05:00
Function that exports (single page) visio diagram as png, and remembers sequence number in windows registry
Sub ExportPNG()
Dim formatExtension As String
formatExtension = ".png"
'//…or .bmp, .jpg, .png, .tif
'// Init folder, doc and counter:
folder = ThisDocument.Path & "Workshop1"
Set doc = Visio.ActiveDocument