Skip to content

Instantly share code, notes, and snippets.

select distinct
pt.id,
pt.gig_id,
pt.amount,
pt.status,
pt.created_at
from payment_transactions pt
join gigs g on g.id = pt.gig_id
join gig_tip_logs pre_tip_log on pre_tip_log.gig_id = g.id and pre_tip_log.operation = 0
left join gig_tip_logs tip_confirmed_log on tip_confirmed_log.gig_id = g.id and tip_confirmed_log.operation = 1
@d-mart
d-mart / kafka-consumer.sh
Last active February 29, 2020 23:21
easy listener for heroku kafka
#!/usr/bin/env bash
set -e
## Prereqs:
## brew install heroku
## brew install kafkacat
## heroku login -i
## Usage exmaple
## $ APP=roadie-admin-qa ./kafka-listener.sh gig.events
@d-mart
d-mart / gist:9db8a61ad18e6e2661e0280608382291
Created March 1, 2018 02:34 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@d-mart
d-mart / inline.sh
Created January 17, 2016 14:08
Create openvpn client files with inline certs and keys
#!/bin/bash
SED=gsed # osx, install via brew
#SED=sed # linux
########################################################################
# Name of certs and keys and client ovpn script
#
client_name="$1"
ca="ca.crt"
cert="${client_name}.crt"

Keybase proof

I hereby claim:

  • I am d-mart on github.
  • I am dmartinez (https://keybase.io/dmartinez) on keybase.
  • I have a public key whose fingerprint is 0D04 04A4 C6F7 F9CA C8DF 23C9 AC2A C8D4 DEE4 78FC

To claim this, I am signing this object:

@d-mart
d-mart / tmux.conf
Created August 20, 2013 13:05
Tmux conf that works on older tmuxen (1.1 ~ 1.6)
###############
## Tmux Settings
###############
## To start a second 'view' of a session in another shell
# tmux new-session -t <session_name>
## Later, kill that second session (see 'tmux ls') linked to the first
# tmux kill-session -t 2
## set Ctrl-a to prefix instead of Ctrl-b
@d-mart
d-mart / woof.py
Created February 5, 2013 14:55
woof.py dated 2012-05-31 from http://www.home.unix-ag.org/simon/woof
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# woof -- an ad-hoc single file webserver
# Copyright (C) 2004-2009 Simon Budig <simon@budig.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@d-mart
d-mart / domain_validator.rb
Created October 4, 2012 21:34 — forked from rietta/domain_validator.rb
Rails 3 Bare Domain Validator
#
# Domain Validator by Frank Rietta
# (C) 2012 Rietta Inc. All Rights Reserved.
# Licensed under terms of the BSD License.
#
# To use in a validation, add something like this to your model:
#
# validates :name, :domain => true
#
class DomainValidator < ActiveModel::EachValidator
@d-mart
d-mart / gist:2923896
Last active October 6, 2015 02:57
Handy git commands I won't remember
# from comments http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export
git archive --format=tar --remote=ssh://remote_server/remote_repository master | (cd /path/to/dir/ && tar -xf -)
# reset author
git commit --amend --reset-author -C HEAD
# show changes made from a paricular commit (diff format)
git show --pretty="format:" d2e4b49
git show --pretty="format:" --name-only d2e4b49