Skip to content

Instantly share code, notes, and snippets.

View faun's full-sized avatar
🌵

Faun faun

🌵
View GitHub Profile
@henrik
henrik / .bashrc
Created December 3, 2008 17:56
Git branch and dirty state in Bash prompt.
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
#!/usr/bin/env ruby
# Posterous.com API HTTP AUTH Example
require 'base64'
require 'open-uri'
require 'net/http'
user = 'email@example.com'
password = 'password'
host = 'posterous.com'
@pal
pal / Capfile
Created February 4, 2010 00:52
Complete Capistrano deployment example for a very simple PHP-site.
# Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
require 'rubygems'
require 'railsless-deploy'
load 'config/deploy'
@mxcl
mxcl / install_homebrew.markdown
Created March 6, 2010 15:14
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
function parse_git_svn_revision {
ref1=$(__git_ps1 | sed -e "s/ (\(.*\))/(git: \1$(parse_git_dirty))/")
#ref1=$(parse_git_branch)
if [ "x$ref1" != "x" ]; then
ref2=$(git branch -a | grep git-svn)
if [ "x$ref2" != "x" ]; then
ref3=$(git svn info | grep Revision)
echo " ${ref1} (svn: r"${ref3#Revision: }") "
else
@ijt
ijt / http_get.go
Last active August 23, 2021 12:37
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@geemus
geemus / addendum.markdown
Created September 1, 2011 20:26
API - Assumptions Probably Incorrect
Feature: Updating an existing request
In order to change my mind about what I need
I want to be able to edit my Request
Background:
Given I am logged in with facebook
And I go to the new request page
And I fill in the following:
| I want | Dragon's Lair Arcade Game |
| for | 2000 |
@aslakhellesoy
aslakhellesoy / edit_request.feature
Created October 5, 2011 17:49 — forked from patrick99e99/edit_request.feature
Refactored from imperative to declarative
Feature: Updating an existing request
In order to change my mind about what I need
I want to be able to edit my Request
Background: Logged in via facebook with one request
Given I am logged in with facebook
And I have a request for "Dragon's Lair Arcade Game" at $2000
Scenario: Logged in users can edit requests
When I change the request to "iPhone6" at $300