This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_git_branch_prompt() { | |
echo " `git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\(\1\)\ /'`" | |
} | |
function git_prompt { | |
local __git_branch='`get_git_branch_prompt`' | |
export PS1="\@ \W\[\033[32m\]$__git_branch\[\033[00m\]\$ " | |
} | |
git_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
#define BUF_SIZE 4096 | |
typedef struct { | |
unsigned long int user; | |
unsigned long int nice; | |
unsigned long int system; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import base64 | |
import os | |
import sys | |
import urllib2 | |
import xml.etree.ElementTree | |
def openUrl(urlStr, user, passwd): | |
req = urllib2.Request(urlStr) | |
authStr = base64.encodestring('%s:%s' % (user, passwd)).strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.time.TimeCategory | |
// create XmlHolder for request content | |
def holder = new com.eviware.soapui.support.XmlHolder( mockRequest.requestContent ) | |
// get arguments | |
def startDateStr = holder["//b:StartDate"] | |
def endDateStr = holder["//b:EndDate"] | |
log.info "start: " + startDateStr + " end:" + endDateStr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
HOSTNAME=`hostname` | |
# command to launch terminal | |
TERM_CMD="xfce4-terminal" | |
# what my terminal window name will always start with | |
NAME_PREFIX="#!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import os, sys | |
# list comprehension to stick a dot onto each given extension | |
exts = ['.' + ext for ext in sys.argv[2:]] | |
# dictionaries that hold the count data | |
fileCount = dict(); lineCount = dict() | |
# functin to count lines in a file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -z "$1" ]; then | |
bname=`basename $0` | |
echo "Usage: $bname SHA" | |
exit 1 | |
fi | |
PATCH_ID=`git show -p $1 | git patch-id | awk '{print$1}'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
int* split(int n, int numPieces); | |
int randInt(int min, int max); | |
int sumList(int* list, int size); | |
void printList(int* list, int size); | |
void seedrand(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Random; | |
import java.lang.Math; | |
public class Split { | |
private static Random rand = new Random(); | |
public static void main(String[] args) { | |
ArrayList<Integer> list = splitNum(Integer.valueOf(args[0]), Integer.valueOf(args[1])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.7 | |
import sys | |
from random import randrange | |
def split(n, numPieces): | |
rtn = [] | |
for i in range(numPieces): | |
# get a good starting position to deviate from |