Skip to content

Instantly share code, notes, and snippets.

Bash

ar1=(1); ar2=(1); [ $ar1 = $ar2 ] && echo true || echo false
true

Python

@pbyrne
pbyrne / gist:bd4e811123be0803f9e7
Last active February 25, 2016 20:41
A recent gnarly bit of Bash I built up over a few minutes until it did what I needed. I was specifically looking to see which, if any, jobs posted to our job board weren't working, since someone reported that they'd clicked a link and it took them to a broken page, but neglected to tell me which posting it was.
# oneliner
for link in $(curl https://dribbble.com/jobs.rss | grep link | cut -d'>' -f2 | cut -d'<' -f1); do echo $link; curl -I --location $link | grep -E '(Location|HTTP)' | cut -d' ' -f2; echo "--------------------"; done
# expanded
for link in $(curl https://dribbble.com/jobs.rss | grep link | cut -d'>' -f2 | cut -d'<' -f1); # cut the URL out of "<link>http://example.com</link>" from our jobs RSS feed
do echo $link # print it
curl -I --location $link | grep -E '(Location|HTTP)' | cut -d' ' -f2 # get the URL, follow any redirects, and print out each redirect and the ending HTTP status code
echo "--------------------"
done
@pbyrne
pbyrne / daredevil.markdown
Created June 5, 2015 00:03
Notes for Daredevil episode of Some Fine TV
@pbyrne
pbyrne / fear-failure-and-imposter-syndrome.markdown
Created September 19, 2014 02:40
A woefully incomplete outline for a talk I'm starting to work on.

Fear, Failure, and Imposter Syndrome

Fear

  • Fear of failure
    • Powerful emotion
    • Stops us from even trying
    • Keeps us on the small potatoes
    • Ignore the big problems, the hard challenges
  • Many of us were "bright kids", and we're not used to failing or tying hard
    • We leave school and enter the real world. Things aren't so easy.
@pbyrne
pbyrne / day-1.markdown
Created July 21, 2014 15:24
My conference notes from DevOpsDays Minneapolis 2014.

Presentations

Opening Keynote

  • Sascha Bates
  • Started Infracoders Minneapolis meetup
@pbyrne
pbyrne / keybase.md
Created July 14, 2014 17:55
Keybase Proof

Keybase proof

I hereby claim:

  • I am pbyrne on github.
  • I am pbyrne (https://keybase.io/pbyrne) on keybase.
  • I have a public key whose fingerprint is D998 4D66 CC5B 33A9 83B8 51AA 3A2F FA10 BF7A D0CD

To claim this, I am signing this object:

@pbyrne
pbyrne / strace_parser.rb
Created February 3, 2014 14:52
Stupid Analysis of `strace` Output
#!/usr/bin/env ruby
#
# Usage:
# strace_parser.rb < file.out
# head -n100 file.out | strace_parser.rb
# strace_parser.rb file.out
class StraceEntry
attr_accessor :line
attr_accessor :pid, :timestamp, :command, :args, :result, :runtime
@pbyrne
pbyrne / bullshit.markdown
Created December 11, 2013 17:05
Hint for Day 1 of Cards Against Humanity's 12 Days of Holiday Bullshit.

For reference, the ciphertext from the note included with your first package:

GR QRW WKURZ DZDB DQBWKLQJ ZH VHQG BRX

Hint: This encrypted with a Ceaser cipher.

@pbyrne
pbyrne / madruby13-day0.markdown
Last active December 22, 2015 05:29
Notes from Madison Ruby 2013. Day 0: Rapid Prototyping workshop, Days 1 and 2 were the conference itself.

Madison Ruby 2013 - Rapid Prototyping

Bermon Painter, Charlotte NC @bermonpainter

TOC - Morning

  • Why's of rapid prototyping
  • Using preprocessors (Slim, Sass)
  • (Afternoon) Pair up and do some rapid prototyping
@pbyrne
pbyrne / gems-for-fun-but-mostly-for-profit.markdown
Created August 29, 2013 02:36
I'm noodling giving a talk at our local Ruby user group (http://ruby.mn). I will discuss some of the less obvious benefits of extracting non-business-logic code out of your application and into gems. Here's my outline so far.

Gems for Fun and Profit. Mostly Profit.

Show of Hands

  • Who has used a gem?
    • Such as Rails, Sinatra, Bundler, Rake
  • Who has written a gem?

Why do We Write Gems?