Skip to content

Instantly share code, notes, and snippets.

Ryan Taylor Long rtlong

View GitHub Profile
View Keybase Proof.md

Keybase proof

I hereby claim:

  • I am rtlong on github.
  • I am rtlong (https://keybase.io/rtlong) on keybase.
  • I have a public key ASCx_dTGMcFs3w8X5MeiySIjv517t1ZgbfM5kyDv5qROTwo

To claim this, I am signing this object:

View movie.md

Movie Ticket Kata

First, head here to join our Zoom meeting. It will help me following along while you work through the assignment.

What Are We Building?

Write a program that calculates purchase price for movie tickets using any language you like. It should not be a full-blown web app; it can be a simple class or collection of methods invokable by your test suite. We'll provide you with some requirements, test-cases, and even a sample interface - all you have to do is give us some software.

Base Admission Rate

View keybase.md

Keybase proof

I hereby claim:

  • I am rtlong on github.
  • I am rtlong (https://keybase.io/rtlong) on keybase.
  • I have a public key whose fingerprint is F1F5 CF22 23FF 597B B717 3843 1CDC F361 D874 2295

To claim this, I am signing this object:

@rtlong
rtlong / connection_pool_issue.rb
Last active Aug 29, 2015
ConnectionPool issue
View connection_pool_issue.rb
#!/usr/bin/env ruby
require 'connection_pool'
require 'redis'
COUNT=1000
$pool = ConnectionPool.new(size: 5, timeout: 10) { Redis.new }
def dont_leak_connection
View Gemfile
source "http://rubygems.org"
gem "janky", "~>0.9"
gem "pg"
gem "thin"
@rtlong
rtlong / get-keys-for-github-user.sh
Last active Feb 13, 2017
Put public keys for a github user in ~/.ssh/authorized keys with mucho ease
View get-keys-for-github-user.sh
IFS="$(printf '\n\t')"
mkdir -p ~/.ssh
if ! [[ -f ~/.ssh/authorized_keys ]]; then
echo "Creating new ~/.ssh/authorized_keys"
touch ~/.ssh/authorized_keys
fi
user=$1
@rtlong
rtlong / console.app_output.
Last active Dec 20, 2015
I'm seeing a 'G-Ear Player Failed to Download' error trying to upgrade to 1.4.35 in the App Store
View console.app_output.
2013-07-21 11:08:37.055 AM App Store[28267]: *** WARNING: Method userSpaceScaleFactor in class NSWindow
is deprecated on 10.7 and later. It should not be used in new applications. Use
convertRectToBacking: instead.
2013-07-21 11:08:38.344 AM storeagent[20851]: *** Assertion failure in
-[SoftwareInstallOperation _startInstall],
/SourceCache/Pisa/Pisa-135.30/iTunes Protocol/Built Into App/SoftwareInstallOperation.m:235
2013-07-21 11:08:38.345 AM storeagent[20851]: error Error Domain=NSURLErrorDomain Code=-1100 "The
installation could not be started." UserInfo=0x7fdd74042b70 {NSLocalizedDescription=The installation
could not be started., NSUnderlyingError=0x7fdd78803550 "The requested URL was not found on this
server."}
@rtlong
rtlong / schema.xml
Created Oct 29, 2012
Sunspot Solr Schema.xml
View schema.xml
<fields>
<!-- Valid attributes for fields:
name: mandatory - the name for the field
type: mandatory - the name of a previously defined type from the
<types> section
indexed: true if this field should be indexed (searchable or sortable)
stored: true if this field should be retrievable
compressed: [false] if this field should be stored using gzip compression
(this will only apply if the field type is compressable; among
the standard field types, only TextField and StrField are)
@rtlong
rtlong / expanded.rb
Created Jun 10, 2012
Ruby ping scan
View expanded.rb
finished = []
ips = []
range = 1..254
range.each do |i|
ip_address = "192.168.111.#{i}"
Thread.new do
`ping -q -c1 -W1 #{ip_address}`.split(/\n+/)[2].split(/,\s*/)[1].to_i > 0 and ips << ip_address
finished << i
end
@rtlong
rtlong / elasticsearch.yml
Created Apr 2, 2012
ElasticSearch #1514 - config file
View elasticsearch.yml
##################### ElasticSearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/reference/setup/installation.html>.
#
# ElasticSearch comes with reasonable defaults for most settings,
You can’t perform that action at this time.