Skip to content

Instantly share code, notes, and snippets.

View nicerobot's full-sized avatar
๐Ÿค–
โ˜ฏ๏ธ โ˜ฎ๏ธ ๐Ÿถ ๐Ÿพ ๐Ÿ‘พ ๐ŸŽฎ ๐ŸŽผ ๐ŸŽถ ๐Ÿ•บ ๐ŸŽง ๐ŸŒป ๐ŸŒฑ ๐Ÿž ๐ŸŒŠ ๐ŸŒ” ๐ŸŒŽ

nicerobot

๐Ÿค–
โ˜ฏ๏ธ โ˜ฎ๏ธ ๐Ÿถ ๐Ÿพ ๐Ÿ‘พ ๐ŸŽฎ ๐ŸŽผ ๐ŸŽถ ๐Ÿ•บ ๐ŸŽง ๐ŸŒป ๐ŸŒฑ ๐Ÿž ๐ŸŒŠ ๐ŸŒ” ๐ŸŒŽ
View GitHub Profile
@nicerobot
nicerobot / mkgithub.sh
Created April 6, 2012 02:05
Mac OS X command-line github repository creator
#!/bin/sh
# curl -ks https://raw.github.com/gist/2316006/mkgithub.sh | sh -s repository-name
[ "${1}" ] || {
echo "usage: ${0} repository-name" >&2
exit ${LINENO}
}
name="${1// /-}"
login="$(sed -n -e '/user/,/name/p' ~/.gitconfig | grep name | awk -F'[ =]+' '{print $2}')"
@nicerobot
nicerobot / nicetempl.sh
Created April 6, 2012 02:34
Template project hierarchy builder for Xcode, eclipse, maven, ...
#!/bin/sh
# curl -ks https://raw.github.com/gist/2316218/nicetempl.sh | sh -s artifact-id group-id
artifactId=${1}
[ "${artifactId}" ] || {
echo "usage: ${0} artifact-id [group-id]" >&2
exit ${LINENO}
}
groupId=${2:-org.nicerobot}
@nicerobot
nicerobot / jarfind.sh
Created April 17, 2012 01:27
Find classes in jar files.
#!/bin/sh
jarfind() {
find ${2:-.} -name '*.jar' | while read j; do
f=$(jar ft ${j} | grep ${1}) && echo ${j} ${f}
done
}
@nicerobot
nicerobot / print.props.scala
Created May 5, 2012 19:26
Print System Properties
sys.props.toSeq.sortBy(_._1).foreach {p => println(p._1+"="+p._2);}
@nicerobot
nicerobot / canonical.sh
Created May 14, 2012 02:53
Canonicalize a file's path i.e. a cross platform readlink
#!/bin/sh
# eg. dir=$(canonical $0)
canonical() {
local d="$(\dirname ${1})"
local f="$(\basename ${1})"
(
\cd ${d} >/dev/null 2>&1
while [ -h "${f}" ] ; do
\cd $(\dirname $(\readlink ${f})) >/dev/null 2>&1
@nicerobot
nicerobot / README.md
Last active February 19, 2025 02:01
Mac OS X uninstall script for packaged install of node.js from https://stackoverflow.com/a/9287292/23056

To run this, you can try:

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
@nicerobot
nicerobot / create-iso.txt
Created May 16, 2012 00:37
Create ISO CD/DVD image (.iso) with Mac OS X Tiger (10.4)
1. Insert CD/DVD source
2. Fire up a Terminal, you can then determine the device that is you CD/DVD drive using the following command:
$ drutil status
Vendor Product Rev
MATSHITA DVD-R UJ-835E GAND
Type: DVD-ROM Name: /dev/disk1
Cur Write: 8x DVD Sessions: 1
Agile Keychain Entry
{
"title" : "dave @ AWS login",
"locationKey" : "perfora.net",
"encrypted" : "...",
"typeName" : "webforms.WebForm",
"securityLevel" : "SL5",
"openContents" : {
"createdAt" : 1216012929,
"passwordStrength" : 100,
@nicerobot
nicerobot / re-debug.txt
Created May 16, 2012 00:42
Debug RE with perl
http://stackoverflow.com/questions/2348694/how-do-you-debug-a-regex/2348725#2348725
$ perl -Mre=debugcolor -e 'm/.../'
Compiling REx "..."
Final program:
1: REG_ANY (2)
2: REG_ANY (3)
3: REG_ANY (4)
4: END (0)
minlen 3