Skip to content

Instantly share code, notes, and snippets.

View wilkes's full-sized avatar

Wilkes Joiner wilkes

View GitHub Profile
@wilkes
wilkes / postgres_queries_and_commands.sql
Created July 7, 2021 14:05 — forked from rgreenjr/postgres_queries_and_commands.sql
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%'
@wilkes
wilkes / 0_reuse_code.js
Created August 29, 2016 15:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
This file has been truncated, but you can view the full file.
/home/petermancini/Downloads/text_without_headers/jeffrey skilling/text_001/3.170043.IKWXXKPFGRPZ5YPLRNQJHDAEJFNGWQKSA.txt
/home/petermancini/Downloads/text_without_headers/jeffrey skilling/text_001/3.176063.BDBSK43E2NJQ40C3PXU1MYUJFQWFHDPPA.txt
/home/petermancini/Downloads/text_without_headers/jeffrey skilling/text_001/3.176169.A1T2FPALR0N5B10RVVAT1TKAAK2DALA4A.txt
/home/petermancini/Downloads/text_without_headers/jeffrey skilling/text_001/3.168320.HQYHCK4E1OJ0SVLCDI1Q0WBASB0W24MOB.txt
/home/petermancini/Downloads/text_without_headers/jeffrey skilling/text_001/3.175958.P3MB3OJLZKBQKSDYITMRWGL2EWH5S4JSA.1.txt
/home/petermancini/Downloads/text_without_headers/jeffrey skilling/text_001/3.168868.IWPSM1CZLZQFO0BBUDBZTTAHZBWP3OXAA.txt
/home/petermancini/Downloads/text_without_headers/jeffrey skilling/text_001/3.168295.BQ5I5QQHYO41JNNRJL0CJUPPUSGV3RRZA.txt
/home/petermancini/Downloads/text_without_headers/jeffrey skilling/text_001/3.175721.BLP5EOEWMJUSP2UGVWABK0USJYIT2KULB.1.txt
/home/petermancini/Downloads/text_wi
@wilkes
wilkes / core.clj
Created June 3, 2010 21:14 — forked from bhenry/core.clj
(ns attendance.core
(:use karras.core
karras.collection
karras.sugar
compojure.core
ring.adapter.jetty
hiccup.core)
(:require [compojure.route :as route]))
(defn home []
(require 'magit)
(defun my-magit-run (&rest args)
(apply #'magit-run (cons "git" args))
(message (mapconcat #'identity args " ")))
(defun my-magit-hack ()
(interactive)
(let ((working-branch (magit-get-current-branch)))
(my-magit-run "checkout" "master")
(ns rabbitmq
(:import (com.rabbitmq.client ConnectionParameters
ConnectionFactory
QueueingConsumer)))
(defstruct connection-info
:username :password :virtual-host :heartbeat :host :port)
(defn connect [info]
(let [connection (.newConnection (ConnectionFactory.
# Make sure your run: sudo chmod u+s /usr/bin/screen
startup_message off
defscrollback 100000 # functionally infinite scrollback
# This will allow for multi-user usage
# I got all the keys off of the deployment server and added them to my 'pair' user account so no password is needed
multiuser on
# change cmd from C-a to C-z to avoid emacs conflict
escape ^zz
(ns rets
(:import (org.apache.http.client HttpClient)
(org.apache.http.client.methods HttpGet HttpPost)
(org.apache.http.impl.client DefaultHttpClient)
(org.apache.http.util EntityUtils)))
(use '[clojure.contrib.str-utils])
(def base-url "http://rets.realtracs.net:6103")
(def login-path "/rets/login")
def test_refer_physician_no_caller(self):
signals.referral_without_caller.disconnect(alerts.referral_without_caller)
callback_called = Ref(False)
def cb(sender, **kwargs):
callback_called(True)
signals.referral_without_caller.connect(cb)
physician = milkman.deliver(Physician, is_active=True)