Skip to content

Instantly share code, notes, and snippets.

@dreyks
dreyks / install_heroku_no_su.sh
Last active August 24, 2016 11:08
Install heroku client on a system with no sudo/su permissions
#!/bin/bash
{
HEROKU_CLIENT_URL="https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz"
LOCAL="$HOME/.local"
LOCAL_HEROKU="$LOCAL/heroku"
LOCAL_BIN="$LOCAL/bin"
echo "This will install heroku-client to $LOCAL_BIN"
echo "This script does NOT require superuser access"
@dreyks
dreyks / thinking_sphinx.rb
Created August 4, 2015 11:24
Thinking Sphinx monkeypatches
# fixing incorrect quoting of full table names
# e.g. db_name.table_name has to be quoted as
# `db_name`.`table_name` not `db_name.table_name`
ThinkingSphinx::ActiveRecord::ColumnSQLPresenter.class_eval do
def with_table
return __name if string?
return nil unless exists?
# original code does this wrong. See +properly_quoted_table+
quoted_table = escape_table? ? properly_quoted_table : table