Skip to content

Instantly share code, notes, and snippets.

@rtlong
rtlong / README.md
Last active October 15, 2024 13:22
Nix Dnsmasq module

To use this, reference this file's path in the modules attr for your system config:

      darwinConfigurations.${hostname} = nix-darwin.lib.darwinSystem {
        modules = [
          ./lib/dnsmasq.nix
        ];
      };

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:

@rtlong
rtlong / movie.md
Created July 13, 2018 20:12 — forked from laser/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

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 August 29, 2015 14:16
ConnectionPool issue
#!/usr/bin/env ruby
require 'connection_pool'
require 'redis'
COUNT=1000
$pool = ConnectionPool.new(size: 5, timeout: 10) { Redis.new }
def dont_leak_connection
@rtlong
rtlong / Gemfile
Created October 23, 2013 19:48 — forked from sr/Gemfile
source "http://rubygems.org"
gem "janky", "~>0.9"
gem "pg"
gem "thin"
@rtlong
rtlong / get-keys-for-github-user.sh
Last active February 13, 2017 15:50
Put public keys for a github user in ~/.ssh/authorized keys with mucho ease
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 December 20, 2015 01:29
I'm seeing a 'G-Ear Player Failed to Download' error trying to upgrade to 1.4.35 in the App Store
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 October 29, 2012 18:21
Sunspot Solr 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 June 10, 2012 23:05
Ruby ping scan
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