Skip to content

Instantly share code, notes, and snippets.

View vangberg's full-sized avatar

Harry Vangberg vangberg

View GitHub Profile
We couldn’t find that file to show.
We couldn’t find that file to show.
We couldn’t find that file to show.
@vangberg
vangberg / gistie.rb
Created July 22, 2008 19:38 — forked from pieter/gistie.rb
gistie
#!/usr/bin/env ruby
# Made by Pieter de Bie <frimmirf@gmail.com>
# Based on a "Pastie" task by someone
require "tempfile"
GIST_URL = 'http://gist.github.com/gists'
GIST_LOGIN_URL = 'https://gist.github.com/session'
USERNAME = "pieter"
PASSWORD = "xxxx"
gem 'dm-core'
require 'dm-core'
APP_ROOT = File.expand_path(File.dirname(__FILE__))
# Database stuff
DataMapper.setup(:default, "sqlite3:#{APP_ROOT}/tezeta.db")
class User
include DataMapper::Resource
property :id, Integer, :serial => true
privat {
# Do we know that extension?
hangup unless @user = User.first(:extension => extension)
# Add to call log
@user.call_logs << CallLog.new(:type => 'incoming', :caller_id => callerid, :created_at => Time.now)
dial(@user.node)
@user.save
}
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1='\[\e[31;1m\]\u@\h:\w$(parse_git_branch)$ \[\e[0m\]'
Once upon a time it suddenly decided to flip backwards, and there went Time