Skip to content

Instantly share code, notes, and snippets.

View alecthegeek's full-sized avatar
🤖
Dem keyboards don't go click click on their own you know

Alec Clews alecthegeek

🤖
Dem keyboards don't go click click on their own you know
View GitHub Profile
@alecthegeek
alecthegeek / SqlplusStartup
Created June 4, 2009 04:30
Oracle SQLplus. Add this to $SQLPATH/login.sql
set sqlprompt "&_USER@&_CONNECT_IDENTIFIER> "
define _editor='c:\Progra~1\Vim\vim72\gvim.exe --nofork'
rem -----
rem Also add to filetype.vim
rem ------------------
@alecthegeek
alecthegeek / Find the git dir for local repo
Last active August 10, 2016 10:45
Are we in a git repo?
if b=`git rev-parse --git-dir 2>/dev/null`; then
echo git here at $b
else
echo no git
fi
@alecthegeek
alecthegeek / Kill UNIX processes by string
Created September 14, 2009 04:37
Kill a proccess identifed vy a string
#! /bin/sh
# See http://partmaps.org/era/unix/award.html#uuk9letter
string="$1" ; export string
scriptname=`basename $0` ; export scriptname
kps=`ps -ef|nawk '$0 ~ ENVIRON["string"] && $0 !~ ENVIRON["scriptname"] {print $2}'`
echo $string has PID \"$kps\"
@alecthegeek
alecthegeek / Dimensions: Find bad item lib files
Created October 16, 2009 04:21
Serena Dimensions admin script
Query that might help locate item library files that have been inserted incorrectly
select filename
from pcms_item_data, pcms_workset_items, pcms_workset_info
where file_version > 1
and lib_file_length = 0
and pcms_workset_info.product_id = '$GENERIC'
and pcms_workset_info.workset_name = '$GLOBAL'
and pcms_workset_info.workset_uid = pcms_workset_items.workset_uid
@alecthegeek
alecthegeek / Text mode 'gitk --all'. Thanks to schacon
Created November 2, 2009 03:09
Provide a text graph of git repo
git log --pretty=oneline --abbrev-commit --all --graph
@alecthegeek
alecthegeek / build IDs with git
Created November 4, 2009 22:04
Generate build ID in Git
use the output of git log -1 '--pretty=format:%h %ai' (example: "d19611c 2009-10-01 01:58:19 -0400")
(from Nikolas Coukouma)
@alecthegeek
alecthegeek / gist:226499
Created November 4, 2009 23:24 — forked from claudinec/gist:226453
Locate dropbox conflicts
find ~/Dropbox -name '*conflicted copy*'
@alecthegeek
alecthegeek / yahoo pipe to filter github RSS feeds
Created November 10, 2009 03:30
yahoo pipe to filter github RSS feeds
http://pipes.yahoo.com/pipes/pipe.info?_id=cde169b7095489431b69b47395e07298
@alecthegeek
alecthegeek / Pomodoro_Template.tsktmpl
Created December 29, 2009 11:07
Pomodoro template for taskcoach
<?xml version="1.0" ?>
<?taskcoach release="0.77.0" tskversion="27"?>
<tasks>
<task id="168052332:1262058476.11" startdatetmpl="Today() + TimeDelta(0)" status="1" subject="Pomodoro Task">
<description>
Estimated : xP
Actual (X):
Internal Interuptions ('):
External Interuption (-):
@alecthegeek
alecthegeek / git-croncheck
Created March 4, 2010 03:24 — forked from elecnix/git-croncheck
be notified when your repo is dirty
#!/bin/bash
# Put this in your crontab to be notified when your repo is dirty or commits needs to be pushed to a remote.
# Example crontab:
# MAILTO=user@yourdomain
# 0 * * * Mon-Fri /path/to/check-repo-status /path/to/repo
cd $1
git status | grep 'working directory clean' 2>/dev/null 1>/dev/null || {
git status
git diff
exit