Skip to content

Instantly share code, notes, and snippets.

# Person has_many cards has_many transaction_feeds.
# I would like to find all of the people with at least one transaction feed with the is_ach bool set to true:
SELECT DISTINCT(people.id) AS person_id FROM `people`
INNER JOIN `cards` ON cards.person_id = people.id
INNER JOIN `transaction_feeds` ON transaction_feeds.card_id = cards.id
WHERE (transaction_feeds.is_ach = 1)
GROUP BY person_id
HAVING COUNT(transaction_feeds.id) > 0;
# This works.
# Heroku S3 Database backup task
# by Nick Merwin (Lemur Heavy Industries) 10.08.09
# * dumps db to yaml, gzip's and sends to S3
#
# Setup:
# 1) replace APP_NAME and BACKUP_BUCKET with your info
# 2) add config/s3.yml like so (same as Paperclip's):
# production:
# access_key_id: ...
# secret_access_key: ...
@ddollar
ddollar / compact.md
Created April 3, 2012 18:07 — forked from geemus/compact.md
markdownish styleguide
$ heroku help apps:create
## Usage:
   heroku apps:create [NAME]
## Description:
   create a new app
## Options:
   --addons ADDONS
      a comma-delimited list of addons to install
   -b, --buildpack BUILDPACK

a buildpack url to use for this app

@ddollar
ddollar / vim.rb
Created January 29, 2013 19:49 — forked from uasi/vim.rb
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.682'
def features; %w(tiny small normal big huge) end
#!/bin/bash
# Usage:
# $ ./heroku-deploy.sh <app name> <git repo url> <heroku api key>
APP="$1"
REPO="$2"
APIKEY="$3"
echo "-----> Creating application $APP"
curl -u ":$APIKEY" -d "app[name]=$APP" -X POST https://api.heroku.com/apps -s > /dev/null
@ddollar
ddollar / create-convox-support.sh
Created October 24, 2017 19:40 — forked from nzoschke/create-convox-support.sh
Creating a convox-support IAM User and Login
$ aws iam create-user --user-name convox-support
{
"User": {
"UserName": "convox-support",
"Path": "/",
"CreateDate": "2015-08-09T15:16:09.027Z",
"UserId": "AIDAIEXRZQYWRHLT6NX6O",
"Arn": "arn:aws:iam::901416387788:user/convox-support"
}
}