Skip to content

Instantly share code, notes, and snippets.

Avatar
🌱
Nurturing plants and code.

Ted Pennings tedpennings

🌱
Nurturing plants and code.
View GitHub Profile
@tedpennings
tedpennings / routes.md
Last active Apr 6, 2020
A year of travel!
View routes.md

I spent six months traveling around the world with my partner Jen. It was one of the most fulfilling and exciting things I've ever done.

This document lists my route, December 2016 to May 2017.

Current status

I'm back in Portland, Oregon! I am so thankful for the opportunity to have spent six months traveling around the world while working remotely. It was one of the most fulfilling experiences of my life. I am back in Portland to stay and excited to call it home. I'm looking forward to re-establishing my yoga practice and getting in skydives toward by B license.

During my travels, I was able to visit thirteen countries: New Zealand, Australia, Indonesia, Taiwan, Malaysia, Thailand, India, Singapore, the United Arab Emirates, Egypt, Morocco, Spain and Canada. All but the last two were new experiences for me. Working while traveling permitted me to stay longer to get a feel for the local culture, and also gave me a feel for local life by requiring me to find wifi and cafes to work.

@tedpennings
tedpennings / places-to-go.md
Last active Jul 1, 2016
Places I want to go!
View places-to-go.md

In the US

  • Crater Lake, Oregon
  • Hawaii
  • Austin, Texas
  • Marfa, Texas (art)
  • New York City

Canada

  • Vancouver, BC
  • Whistler
@tedpennings
tedpennings / roa2016.md
Last active Apr 6, 2016
Ruby on Ales notes 2016
View roa2016.md

Ruby on Ales 2016

Ted's notes (@thesleepyvegan)

Ruby on Ales schedule. Notes are in order from almost all the sessions. I didn't see Choices by Ernie Miller.

Twitternets: #roa2016

Open source survival guide

Mike Moore (@blowmage)

View 30before30.md

30 in 30

I turn 30 in October. Here are some things I've always wanted to do but haven't done, or have fallen out of the habit of doing. I plan to do these things before 🍰 🎉

Personal

  • Begin a daily meditation practice
  • Read 30 books
  • Read a book in another language. In college, I studied up to various levels of reading competency in Spanish, German, Ancient Greek and French. I've let that knowledge go.
  • Establish a daily and weekly routine, waking up at a certain time, with time for chores and a somewhat-set “bedtime"
  • Volunteer
  • Go on a hike
@tedpennings
tedpennings / greedy_example.rb
Last active Aug 29, 2015
greedy greedy algorithm
View greedy_example.rb
#!/usr/bin/env ruby
# The challenge:
# Given a dollar amount, determine which bills to dispense, optimizing for fewest bills, using a greedy algorithm
# Ted Pennings, 2015, License: http://choosealicense.com/licenses/unlicense/
AVAILABLE_BILLS = [100, 50, 20, 10, 5, 1] # nobody wants $2 bills
@tedpennings
tedpennings / gist:ad843590a01db440b382
Last active Aug 29, 2015
Untappd user's favorite beer styles
View gist:ad843590a01db440b382
// 1. Go to a page like https://untappd.com/user/thesleepyvegan/beers?filter_type=type&filter_id=all&sort=
// 2. Open the Javascript console (Mac Chrome: Apple+Option+J)
// 3. Run the following Javascript snippet:
$('#style_picker option').map(function(i,e) { return $(e).text() }).splice(1).map(function(s) { var item = /([A-z/\(\) ]+) \((\d+)\)/.exec(s); return [item[1], parseInt(item[2])]; }).sort(function(a,b) { return b[1] - a[1]; });
// 4. Explore the resulting array and enjoy!
// Here are comments on what it does. Some browsers may require you to remove the comments for chaining
$('#style_picker option') // select the beer text from the style picker dropdown
.map(function(i,elem) { return $(elem).text() }) // take the text description of each
@tedpennings
tedpennings / Actual script
Last active Mar 8, 2020
Shellshock exploit attempt from the wild
View Actual script
# The Base 64 decoded version of that script -- contents begin on next line
######################################################################################################################
######################################################################################################################
## DDoS Perl IrcBot v1.0 / 2012 by DDoS Security Team ## [ Help ] ###########################################
## Stealth MultiFunctional IrcBot writen in Perl #######################################################
## Teste on every system with PERL instlled ## !u @system ##
## ## !u @version ##
## This is a free program used on your own risk. ## !u @channel ##
## Created for educational purpose only. ## !u @flood
@tedpennings
tedpennings / gist:a1f670e1e618f3e7ce2f
Created Oct 17, 2014
My ~/.profile, minus work-related aliases
View gist:a1f670e1e618f3e7ce2f
export PATH=/usr/local/bin:$PATH:~/bin
eval "$(rbenv init -)"
export GREP_OPTIONS="--color=auto"
BREWDIR=$(brew --prefix)
if [ -f $BREWDIR/etc/bash_completion ]; then
source $BREWDIR/etc/bash_completion
fi
@tedpennings
tedpennings / missing_tests.rb
Last active Aug 29, 2015
Find Homebrew Formulas that are missing tests!
View missing_tests.rb
#! /usr/bin/env ruby
# Find Homebrew formulas that are missing tests!
# Usage: run from checked out Homebrew repository root
# $ git clone git@github.com:Homebrew/homebrew.git && cd homebrew
# $ curl https://gist.githubusercontent.com/tedpennings/9148810/raw/ > missing_tests.rb
# $ chmod +x missing_tests.rb
# $ ./missing_tests.rb
min_commits = 25
@tedpennings
tedpennings / gist:6253541
Last active Jan 14, 2020
A very simple search implementation for Jackson JsonNodes using recursive DFS
View gist:6253541
private JsonNode searchForEntity(JsonNode node, String entityName) {
// A naive depth-first search implementation using recursion. Useful
// **only** for small object graphs. This will be inefficient
// (stack overflow) for finding deeply-nested needles or needles
// toward the end of a forest with deeply-nested branches.
if (node == null) {
return null;
}
if (node.has(entityName)) {
return node.get(entityName);