Skip to content

Instantly share code, notes, and snippets.

View ericboehs's full-sized avatar

Eric Boehs ericboehs

  • Oddball
  • Enid, OK
  • 18:31 (UTC -06:00)
View GitHub Profile
# ~/.bash_profile
# Eric Boehs's git aliases
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gd='git diff | mate'
alias gl='git pull'
alias gp='git push'
alias gst='git status'
# ~/.bash_profile
# Eric Boehs's git aliases
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gd='git diff | mate'
alias gl='git pull'
alias gp='git push'
alias gst='git status'
#!/bin/bash
PS=$(
ps auxc |
head -6 |
tail -5 |
awk '{
printf("%6s %s %s %6.2f%s", $2" ",$3"\t",$4"\t",$6/1024,"M\t");
for (i = 10 + 1; i <= NF; i++ )
printf("%s ", $i);
print "";
@ericboehs
ericboehs / gist:146661
Created July 14, 2009 02:36
Init's a git repo on a remote git server and then pushes the current directory to it (not for use w/ github)
#!/bin/bash
# rgi by Eric Boehs
# I like to put this in my ~/bin (which I put in my path) as rgi (remote git initialize)
# Specify your remote user@server here
[email protected];
# ======================
# = END OF USER CONFIG =
# ======================
# Migrating from your Unfuddle git repo to GitHub
cd YOUR_GIT_REPO
git remote rm unfuddle
git remote add origin [email protected]:opubco/YOUR_REPO_NAME.git
git push origin master
# If you don't like typing git push origin master, set it up in your .git/config
echo '[remote "origin"]
url = [email protected]:opubco/YOUR_REPO_NAME.git
fetch = +refs/heads/master:refs/remotes/origin/master
<?
#PHP REST client
$url = 'http://localhost:8080/classica/api/listings/5';
$method = 'PUT';
$headers = array(
'Accept: application/json',
'Content-Type: application/x-www-form-urlencoded'
);
$dataarr = array(
#!/bin/bash
## Screenshot script for Mac OS X
## Author: Eric Boehs
## URL: ericboehs.com
# Set these variables:
USERNAME=ericboehs
SERVER=ericboehs.com
DIR=\~/ericboehs.com/screenshots/
FILENAME=`date +%Y%m%d-%H%M%S`
<?
echo "<pre>";
// This example should work but some http servers will not respond properly to a HEAD request
// i.e. google.com
$url = 'http://ericboehs.com/uploads/gahr-1.png';
$ch = curl_init();
if (!$ch)
<?
echo "<pre>";
// This example should work but some http servers will not respond properly to a HEAD request
// i.e. google.com
$url = 'http://ericboehs.com/uploads/gahr-1.png';
$ch = curl_init();
if (!$ch)
<?
$feed_stub = array('xml', 'feed', 'player', 'stats.xml');
foreach($feed_stub as $i => $f){
if($i == count($feed_stub)-1)
continue;
$feed_path .= "[$f]";
}
$test{$feed_path} = 'blah'; // Result: $test[[foo][bar]] => blah
//Desired result: $test[foo][bar] => blah