Skip to content

Instantly share code, notes, and snippets.

View cblackburn-ajla's full-sized avatar
🏠
Working from home

Chris Blackburn cblackburn-ajla

🏠
Working from home
View GitHub Profile
@cblackburn-ajla
cblackburn-ajla / GIF-Screencast-OSX.md
Created May 18, 2021 16:39 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

-- 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%'
@cblackburn-ajla
cblackburn-ajla / rbenv-install-system-wide.sh
Created June 7, 2018 15:14 — forked from jpfuentes2/rbenv-install-system-wide.sh
CentOS: rbenv install and system wide install
#!/bin/bash
# CentOS rbenv system wide installation script
# Forked from https://gist.github.com/1237417
# Installs rbenv system wide on CentOS 5/6, also allows single user installs.
# Install pre-requirements
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \
make bzip2 autoconf automake libtool bison iconv-devel git-core

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@cblackburn-ajla
cblackburn-ajla / watcher.rb
Created November 16, 2017 14:29
Watchers in ruby at the instance variable level.
module Watcher
# Ensure compatibility.
def self.included( mod )
mod.extend( self )
end
# Declare a watcher. The block or lambda will be invoked with argumens of what the value was and now is, in that
# order.
def watch( sym, lambda = nil, &block )