Skip to content

Instantly share code, notes, and snippets.

@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 / programmers_dvorak.menu.lst
Created April 3, 2010 07:41
GRUB programmers dvorak keymap. Utilize your DVORAK layout within GRUB consoles and editing/debugging
# GRUB programmers dvorak keymap - Ryan T Long <ryan@rtlong.com>
# paste this in the top of your menu.lst (above any menu items)
# row 1
setkey dollar backquote
# setkey tilde tilde
setkey ampersand 1
setkey percent exclam
setkey bracketleft 2
setkey 7 at
@rtlong
rtlong / README.md
Created February 18, 2011 21:59
Template bash script, for when you need something over-engineered.

This template script was retrieved from BigSmoke's Blog on 18 February 2011. It was originally authored by [Wiebe Cazemier](mailto:Wiebe Cazemier ) and he deserves the credit. I am putting it on gist.github.com so I don't lose it, mostly, although I hope someone else is able to find it as useful as I do.

@rtlong
rtlong / move-then-link-to.sh
Created February 19, 2011 00:10
This script automates the process of moving a file or directory, then creating a link from it's new location to it's old location. I am using it to add application config files to my Dropbox folder.
@rtlong
rtlong / README
Created August 22, 2011 18:33
issue with git rebase -i
This is meant to supplement the question on StackOverflow, here:
http://stackoverflow.com/questions/7137985/git-rebase-i-head7-showing-only-noop-in-editor
@rtlong
rtlong / install_homebrew.rb
Created February 5, 2012 04:38 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
#!/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
@rtlong
rtlong / locale.rb
Created March 5, 2012 02:56 — forked from aulizko/locale.rb
Exports $app/config/locale/$locale.yml contents to mongodb database
# usage:
# bundle exec rake locale:file RAILS_ENV=production
# if you want to export a different locale (not en.yml), provide locale option, as follows:
# bundle exec rake locale:file RAILS_ENV=production locale=ru
require 'mongo-i18n'
def write_to_database(sc, path, value)
key = path.join('.')
sc[key] = value.to_json
@rtlong
rtlong / elasticsearch.yml
Created April 2, 2012 02:32
ElasticSearch #1514 - config file
##################### 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,
@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)

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: