Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
matthewmccullough / gist:47267
Created January 15, 2009 05:15 — forked from halbtuerke/gist:31934
Show Git dirty status in your Unix bash prompt (symbols not compatible with CygWin)
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@donatj
donatj / hl.cfg
Created December 9, 2010 15:52
PhpED Dark Highlighting Configuration
<?xml version="1.0" encoding="utf-8"?><root version="6000"><sect_php><name_0>Whitespace</name_0><color_0>clNone</color_0><fontcolor_0>clTeal</fontcolor_0><isbold_0>0</isbold_0><isunderline_0>0</isunderline_0><isitalic_0>0</isitalic_0><isstikeout_0>0</isstikeout_0><name_1>String</name_1><color_1>clNone</color_1><fontcolor_1>$003CCE94</fontcolor_1><isbold_1>0</isbold_1><isunderline_1>0</isunderline_1><isitalic_1>0</isitalic_1><isstikeout_1>0</isstikeout_1><name_2>Comment</name_2><color_2>clNone</color_2><fontcolor_2>$00AEAEAE</fontcolor_2><isbold_2>0</isbold_2><isunderline_2>0</isunderline_2><isitalic_2>1</isitalic_2><isstikeout_2>0</isstikeout_2><name_3>Text</name_3><color_3>clNone</color_3><fontcolor_3>clNone</fontcolor_3><isbold_3>0</isbold_3><isunderline_3>0</isunderline_3><isitalic_3>0</isitalic_3><isstikeout_3>0</isstikeout_3><name_4>Reserved words</name_4><color_4>clNone</color_4><fontcolor_4>$004848E1</fontcolor_4><isbold_4>1</isbold_4><isunderline_4>0</isunderline_4><isitalic_4>0</isitalic_4><isstikeou
@iansheridan
iansheridan / git-cheat-sheet.md
Created March 15, 2011 14:25
A cheat sheet for GIT

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

@karmi
karmi / elasticsearch_highlight.sh
Created April 20, 2011 13:32
Highligthing in ElasticSearch; number_of_fragments bug
# (Re)create the index
curl -X DELETE "http://localhost:9200/highlight"
curl -X PUT "http://localhost:9200/highlight"
# Insert the data
curl -X POST "http://localhost:9200/highlight/document" -d '{ "body" : "The quick brown fox jumps over the lazy dog" }'
curl -X POST "http://localhost:9200/highlight/document" -d '{ "body" : "Lazy dog jumps over the quick brown fox" }'
curl -X POST "http://localhost:9200/highlight/document" -d '{ "body" : "A Fox one day fell into a deep well and could find no means of escape. A Goat, overcome with thirst, came to the same well, and seeing the Fox, inquired if the water was good. Concealing his sad plight under a merry guise, the Fox indulged in a lavish praise of the water, saying it was excellent beyond measure, and encouraging him to descend. The Goat, mindful only of his thirst, thoughtlessly jumped down, but just as he drank, the Fox informed him of the difficulty they were both in and suggested a scheme for their common escape. \"If,\" said he, \"you will place your
@craigmarvelley
craigmarvelley / commands.txt
Created May 11, 2011 16:33
Setting up a Symfony 2 project with bleeding edge vendors on Windows
git init
mkdir vendor
git submodule add git://github.com/kriswallsmith/assetic.git vendor/assetic
mkdir vendor\bundles\JMS
git submodule add https://github.com/schmittjoh/SecurityExtraBundle.git vendor/bundles/JMS/SecurityExtraBundle
mkdir vendor\bundles\Sensio\Bundle
@karmi
karmi / elastic_search_ngram_analyzer_for_urls.sh
Created May 24, 2011 15:32
NGram Analyzer in ElasticSearch
# ========================================
# Testing n-gram analysis in ElasticSearch
# ========================================
curl -X DELETE localhost:9200/ngram_test
curl -X PUT localhost:9200/ngram_test -d '
{
"settings" : {
"index" : {
"analysis" : {
curl "http://localhost:9200/insider/_search?pretty=true" -d '
{
"size" : 0,
"facets" : {
"tag" : {
"terms" : {
"field" : "url",
"script" : "term.replace(/(^http:\/\/[^\/]+).*/, \"$1\")"
}
}
@ejucovy
ejucovy / program.py
Created June 12, 2011 11:49
supervisorctl tail -f
import random
import sys
while True:
print random.random()
sys.stdout.flush()
@donatj
donatj / ColorCLI.php
Created October 26, 2011 03:34
Simple CLI color class
<?php
class ColorCLI {
static $foreground_colors = array(
'bold' => '1', 'dim' => '2',
'black' => '0;30', 'dark_gray' => '1;30',
'blue' => '0;34', 'light_blue' => '1;34',
'green' => '0;32', 'light_green' => '1;32',
'cyan' => '0;36', 'light_cyan' => '1;36',
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu