Skip to content

Instantly share code, notes, and snippets.

PROMPT_COLOR=${PROMPT_COLOR:-'\[\033[01;38;5;56m\]'}
VIRTUAL_ENV_DISABLE_PROMPT=1
function prompt_command()
{
local EXIT=$?
# Color codes
local PROMPT_COLOR=${PROMPT_COLOR:-'\[\033[01;35m\]'}
local RESET_COLOR='\[\033[00m\]'
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Usage $0 <directory>"
exit
fi
DIR=$1
#!/bin/bash
YEAR=`date +%Y`
echo "YEAR: $YEAR"
MONTH=`date +%m`
echo "MONTH: $MONTH"
DAY=`date +%d`
echo "DAY: $DAY"
mkdir -p $YEAR/$MONTH
#include <assert.h>
#include <stdio.h>
#include <set>
#include <vector>
// INTERFACE
class GcObject;
@Calmarius
Calmarius / qtokenize.c
Created August 5, 2014 23:46
Quoted string tokenizer function
#include <stdio.h>
#include <assert.h>
#include <string.h>
/**
* Tokenizes string.
*
* str [in]: pointer to a zero terminated string. Required
* token [out]: pointer to an user specified buffer to hold the token. The user must ensure the buffer is long enough. Required.
* delimiter [in]: the character that delimits the tokens. (eg. space). Shouldn't be '\0'.
@Calmarius
Calmarius / gist:24bdf9b753eb0553c148
Last active July 24, 2022 04:09
PHP diff algorithm with minimum gap removal
/**
* Removes gaps between the diff block by fusing the lines into the diff.
*
* $diff: A diff created by computeDiff.
* $minGaps: a number specifying the smallest allowable gap between two diff blocks.
*
* Returns a new diff (see computeDiff for details.)
*/
function removeDiffGaps($diff, $minGaps)
{