Skip to content

Instantly share code, notes, and snippets.

View mjallday's full-sized avatar
🏠
WFH

Marshall Jones mjallday

🏠
WFH
View GitHub Profile
# bashrc
if [ -e ${HOME}/.git-completion.bash ]; then
source ${HOME}/.git-completion.bash
git_branch () {
__git_ps1 "(%s)"
}
else
git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
@mjallday
mjallday / meta.rb
Last active August 29, 2015 14:04 — forked from rserna2010/gist:2ebe2fa4f8afc7b113bb
Balanced - Filter by meta fields (Ruby)
Find By Email
Balanced::Customer.where(:email => 'jim@gmail.com').all
Find By Meta
Balanced::Debit.where('meta.orderid' => '12345').all
Combo
Balanced::Debit.where('meta.order' => '12345', "status"=>"succeeded").all
Find By Date
@mjallday
mjallday / bg_task.py
Created December 4, 2013 19:00 — forked from amjith/bg_task.py
import newrelic.agent
import time
import logging
logging.basicConfig()
logger = logging.getLogger('newrelic')
logger.setLevel(logging.DEBUG)
newrelic.agent.initialize('newrelic.ini', environment='staging')
newrelic.agent.register_application(timeout=10.0)
def merchant
after_redirection = "#{root_url}balanced/success"
current_user = User.find(session[:user_id])
begin
existing=Balanced::Account.find_by_email(current_user.email)
if existing.nil?
@market = marketplace_creation
marketplace = @market
bank_account = marketplace.create_bank_account(
:account_number => params[:account_number],
@mjallday
mjallday / postgresql.rb
Created September 11, 2012 22:50 — forked from trisweb/postgresql.rb
Homebrew PostgreSQL 9.2 Formula
require 'formula'
class Postgresql < Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp.postgresql.org/pub/source/v9.2.0/postgresql-9.2.0.tar.bz2'
md5 '8c4c32a4abe8cf61b02c8366181ede50'
depends_on 'readline'
depends_on 'libxml2' if MacOS.leopard? # Leopard libxml is too old
depends_on 'ossp-uuid'
@mjallday
mjallday / gist:3490698
Created August 27, 2012 17:39 — forked from skeet70/gist:3490374
Balanced payment form
{% extends "base_site.html" %}
{% block title %}Payment Processing{% endblock %}
{% block js %}
<script type="text/javascript" src="https://js.balancedpayments.com/v1/balanced.js"/>
<script type="text/javascript">
var marketplaceUri = '/v1/marketplaces/TEST-MP2CSIcjO337fwEoqBrlvB5I';