Skip to content

Instantly share code, notes, and snippets.

View abelmartin's full-sized avatar
😅

Abel Martin abelmartin

😅
  • Rhino
  • Washington, DC
View GitHub Profile
@abelmartin
abelmartin / gist:e90f80c60fa7e1bd5e36174fbb651cb6
Created December 19, 2017 05:36 — forked from jordelver/gist:5617879
Spell check entire codebase

Spell check entire codebase

Requires aspell. Install using brew install aspell on Mac OS X.

From STDIN

cat *.txt | aspell -l EN-US --mode=tex list

Whole directory

KEYBINDINGS
byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings
are:
F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
@abelmartin
abelmartin / postgres_queries_and_commands.sql
Created September 22, 2017 17:25 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), 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(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@abelmartin
abelmartin / mongodb.md
Created December 6, 2016 19:25
#mongodb cheat sheet

MongoDB cheat sheet

Overview

Overview

MongoDB is a document database that provides high performance, high availability, and easy scalability.

  • Document Database
@abelmartin
abelmartin / postgres-cheatsheet.md
Created October 26, 2016 00:14 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

import requests, json
from collections import Counter
districts = json.loads(requests.get('http://public-crest.eveonline.com/districts/').text)['items']
systems = {}
constellations = {}
s_times = {}
c_times = {}
def output name=((default=true); "caius")
puts "name: #{name.inspect}"
puts "default: #{default.inspect}"
end
output
# >> name: "caius"
# >> default: true
output "avdi"
@abelmartin
abelmartin / irb3.rb
Created November 4, 2011 14:45 — forked from peterc/irb3.rb
irb3 - Run an IRB-esque prompt over multiple Ruby implementations at once using RVM
#!/usr/bin/env ruby
# encoding: utf-8
# irb3 - Runs an IRB-esque prompt (but it's NOT really IRB!) over multiple
# versions of Ruby at once (using RVM)
#
# By Peter Cooper, BSD licensed
#
# Main dependency is term-ansicolor for each impl:
# rvm exec gem install term-ansicolor