Skip to content

Instantly share code, notes, and snippets.

View sycobuny's full-sized avatar

Stephen Belcher sycobuny

  • Kelly Services, NIH/NIA
  • Baltimore, MD
View GitHub Profile
@sycobuny
sycobuny / new.sql
Created August 12, 2014 18:22
Just my new style of query writing
SELECT
a.column1 AS a_col1,
a.column2 AS a_col2,
b.column1 AS b_col1,
b.column2 AS b_col2
FROM
asdf a INNER JOIN
qwerty b ON
a.id = b.qwerty_id
WHERE
MyApp = angular.module('my-app', [])
MyApp.run(function($rootScope) {
testFactory.callFakeAJAX().success(function(response) {
console.log(response.data)
})
})
/***********
* MOCKING *
***********/
@sycobuny
sycobuny / gen-key.bash
Last active March 29, 2024 20:31
Quick script to generate new GPG keys (and export pertinent details)
#!/bin/bash
# Print a welcome banner for the user.
function Welcome() {
echo ""
echo "================================"
echo "Welcome to the GPG Key Generator"
echo "================================"
echo "Please select a STRONG passphrase. Once entered and verified, the"
echo "system must generate and collect enough random data to create your"
@sycobuny
sycobuny / .tmux.conf
Created June 4, 2015 15:55
Mapping new keys for resizing windows
# Allows us to resize windows with WASD like a video game
# Primarily useful when we're on a system with a vanilla setup (no option-as-Meta Key enabled)
# Note that these are upper-case letters - tmux is case-sensitive
bind-key -r W resize-pane -U 5
bind-key -r A resize-pane -L 5
bind-key -r S resize-pane -D 5
bind-key -r D resize-pane -R 5
@sycobuny
sycobuny / transcript.md
Created July 31, 2015 19:37
Transcription (so far) of my "Motion Commands" talk

Today I'm going to do a presentation, for some reason sillily [sic] titled "Around the File in 80 Keys". I'm actually not going to go over 80 different keys you can use to navigate in Vim, I'm just going to go over a few. There might not even be 80 keystrokes in the presentation itself. But, I thought it was cute.

But first, I actually wanted to say thank you to all of you who have come tonight, it's the first meetup of this kind that I've setup, and I hope that it's educational, or entertaining, or worthile. But, if there are any suggestions you have, comments, or particularly my favorite thing you could

@sycobuny
sycobuny / captions.sbv
Created July 31, 2015 19:46
Closed Captioning File for YouTube video at https://www.youtube.com/watch?v=-mr9WOI1jK0
0:00:00.160,0:00:01.780
[Amustela]: Please welcome to the stage...
0:00:01.780,0:00:03.960
[Amustela]: From Baltimore, Maryland...
0:00:05.300,0:00:09.640
[Amustela]: The magnificent Dark Phoenix...
0:00:09.640,0:00:13.340
@sycobuny
sycobuny / README.md
Last active March 17, 2016 07:03
A problem I'm encountering with pgTAP (http://pgtap.org/)

The Problem

I'm hoping to test a function that I will eventually use in a DOMAIN to verify that any given JSONB object adheres to a certain loose set of constraints (other JSONB types will be built on constraints specified in this DOMAIN).

As the DOMAIN will already fail anything that doesn't pass the function, I did not write the function to raise exceptions, but rather to raise warnings,

@sycobuny
sycobuny / pg_isolation.rb
Last active August 27, 2015 14:21
Rack middleware to (theoretically) "isolate" certain requests in a read-only transaction
# "Isolates" Rack operations via Sequel/PostgreSQL into read-only transactions
#
# @note (see PGIsolation#shadow_tables!)
class PGIsolation
attr_reader :app, :db_method, :shadow_tables, :setup, :teardown,
:isolation_check
# A template for creating multiple temporary tables in sequence
#
# Due to the +LIKE+ clause (and <tt>INCLUDING DEFAULTS</tt>), these tables
@sycobuny
sycobuny / ansible.cfg
Created November 12, 2015 22:46
Silly example ansible dynamic inventory
[defaults]
inventory = ./inventory.pl
@sycobuny
sycobuny / output.txt
Created January 16, 2016 23:22
tmux control mode output
~$ tmux -CC
** tmux mode started **
Command Menu
----------------------------
esc Detach cleanly.
X Force-quit tmux mode.
L Toggle logging.
C Run tmux command.
Detached