Skip to content

Instantly share code, notes, and snippets.

@coderjoe
coderjoe / keybase.md
Created March 19, 2015 02:23
keybase.md

Keybase proof

I hereby claim:

  • I am coderjoe on github.
  • I am coderjoe (https://keybase.io/coderjoe) on keybase.
  • I have a public key whose fingerprint is 2A88 7C59 D305 C334 76B3 4463 8195 A93E 45D4 23EC

To claim this, I am signing this object:

@coderjoe
coderjoe / how to run
Last active August 29, 2015 13:59
Test subprocess sighup handling
run the bash script with:
./test.sh &
run the node script with:
node ./test.js >> logfile.txt &
Kill either with:
@coderjoe
coderjoe / self_closing_example.xhtml
Created June 11, 2012 15:39
Self closing tag example XHTML transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
</head>
<body>
XHTML Example:
<span style="color: green"><span style="color: red" />
If self closing works this text should be green.
@coderjoe
coderjoe / self_closing_example.html
Created June 11, 2012 15:39
Self closing HTML 4.01 transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
HTML Example:
<span style="color: green"><span style="color: red" />
If self closing works this text should be green.
</span>
@coderjoe
coderjoe / gist:1450520
Created December 9, 2011 06:45
Storing the output of a command in an array and passing it to another program as arguments
#!/bin/bash
#Create an empty directory
#Save this script as test.sh within it
#create three example files
touch one\ file.txt
touch two.txt
touch three\ files\ here.txt
#Our directory contains 4 files, this script and the example files
@coderjoe
coderjoe / gist:1449820
Created December 9, 2011 02:20
Parse a list of files
#is it coming from another file?
#is it newline separated?
#if not you can use IFS to change the separation character
for i in `ls`
do
echo "$i"
done
#What if there are spaces?
@coderjoe
coderjoe / butternut_squash_soup.md
Created October 25, 2011 00:58
Butternut Squash Soup

Butternut Squash Soup

Note: requires stockpot.

Ingredients

  • extra virgin olive oil
  • 1 stick butter
@coderjoe
coderjoe / evil_backtick_overload.rb
Created December 20, 2010 22:39
This is a really bad idea
require 'uri'
module ReallyBadIdea
alias_method :old_tick, :`
def `(uri)
begin
URI.parse(uri)
rescue URI::InvalidURIError
Tuning - D A D F# A D
Capo on 5
D |--4---4------7----7--------0---2s4-2-0------------0-------------------0-|
A |-----5-5s7------7------0h3--3----------------0---------0----------0-----|
F#|----0----------0-------------------------0h1--1----1-----1----------1---|
D |------------------------------------------------------------------------|
A |-----------------------------------------2------2----2-----2------------|