Skip to content

Instantly share code, notes, and snippets.

@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
@ericbmerritt
ericbmerritt / Makefile
Last active August 11, 2023 09:35
Universal drop in Makefile for Erlang projects that use rebar
# Copyright 2012 Erlware, LLC. All Rights Reserved.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
@mateusg
mateusg / sample_deploy.rb
Created December 19, 2012 14:18
Clean Capistrano deploy file with bundler + rvm + permissions restore
# *** RVM CONFIGURATION ***
set :rvm_ruby_string, "ree-1.8.7-2012.02@#####"
set :rvm_type, :system
before 'deploy:setup', 'rvm:install_rvm' # install RVM
before 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset, or:
require 'rvm/capistrano'
require "bundler/capistrano"
set :application, "#######"
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 4, 2025 11:28
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@alakra
alakra / gist:3183982
Created July 26, 2012 19:22
S-Expression compiler for Ladder Logic (version 1)
# luby.rb --
#
# This file translates S-Expressions as a mark-up language into ladder
# logic which can be used by the Ladder Logic Editor by Sylva Control Systems.
#
# Copyright (c) 2006 RODI Systems, Inc.
#
# See the file "LICENSE" for more information on usage and redistrution of
# this file and for a DISCLAIMER OF ALL WARRANTIES.
@robcowie
robcowie / woof.py
Created April 20, 2010 18:14
woof.py One-time file server
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# woof -- an ad-hoc single file webserver
# Copyright (C) 2004-2009 Simon Budig <[email protected]>
#
# 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.