Skip to content

Instantly share code, notes, and snippets.

function parse_git_branch {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
GREEN="\[\033[1;32m\]"
YELLOW="\[\033[1;33m\]"
WHITE="\[\033[0;0m\]"
PS1="[\u@\h [$GREEN\W$YELLOW\$(parse_git_branch)$WHITE]\$ "
# 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
<?php
echo "hello gistson";
?>
@phatduckk
phatduckk / Gistson.php
Created December 7, 2009 08:54
Embed a Gist in Wordpress
<?php
/*
Plugin Name: Gistson - Embedded Gist WP Plugin
Plugin URI: http://arin.me/blog/tag/gistson
Description: Use a shortcode [gist id="12345"] to embed A Gist from http://gist.github.com into your blog
Version: 0.1
Author: Arin Sarkissian
Author URI: http://arin.me
Copyright 2009 Arin Sarkissian
<?php
if (! isset($argv[1])) {
echo "enter a search term:\n";
echo 'php ' . __FILE__ . " <search_term>\n";
exit;
}
$term = urlencode($argv[1]);
$url = "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsSearch?limit=10&entity=software&term=$term";
package com.digg.tmp;
import org.neo4j.api.core.*;
import org.neo4j.util.index.SingleValueIndex;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* Hack example that reveals a "More than one relationship" issue
*
package com.digg.tmp;
import org.neo4j.api.core.*;
import org.neo4j.util.index.SingleValueIndex;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* Hack example that reveals a "More than one relationship" issue
package com.digg.tmp;
import org.neo4j.api.core.*;
import org.neo4j.util.index.IndexService;
import org.neo4j.util.index.LuceneIndexService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class LuceneIndex {
<?php
class UserDataAccessClass
{
/**
* Get the number of followers a user has
*
* @param string $userID The user id
*
* @return int
*/
<?php
class UserDataAccessClass
{
/**
* @return int
*/
public function getNumFollowers(string $userID)
{
return valueFromAServiceCallOrQueryEtc($userID)
}