Skip to content

Instantly share code, notes, and snippets.

😬
Getting pucks deep

Steven Black StevenBlack

😬
Getting pucks deep
Block or report user

Report or block StevenBlack

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@StevenBlack
StevenBlack / pg_change_db_owner.sh
Created Apr 8, 2018 — forked from jirutka/pg_change_db_owner.sh
Some convenient scripts to manage ownerships and privileges in PostgreSQL.
View pg_change_db_owner.sh
#!/bin/sh
#
# The MIT License
#
# Copyright 2014-2017 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
View postgres_queries_and_commands.sql
-- 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%'
@StevenBlack
StevenBlack / postgres-cheatsheet.md
Created Apr 8, 2018 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
View genesis_public_key
04d4dbb7d597566748e73f79c76aff1b58ac727b35c6feaea0d90b21b115783525007b5224e46e08dadfaa52b9c76dd9fbbc47278482880b7c82b0a54b54b643e2
View gist:170202c0c25c3928d5ecc34c5df9b540
Standups:
2-3 times per night
post issues to Slack
designate scrum master and rotate who the master will be
scrum master gives everyone a turn to speak
Conflicts:
Write down your conflict
Spend 15 minutes tops to resolve the conflict and move on.
We are all on the same team with the same goal
View iPhone repair notes.md
  • This phone had its original cracked screen replaced at an iService frachise.
  • The current screen worked for awhile, then gradually failed
  • The current screen doesn't work at all, and the phone is disabled.

Please replace the screen, then ship to the address on the work order.

View Agou setup
- [ ] Install ITerm2 app – https://www.iterm2.com/
- [ ] Install Sublime Text app – https://www.sublimetext.com/ and the `subl` command line tool
- [ ] Install MacDown app – http://macdown.uranusjr.com/
- [ ] Update Chrome to latest
- [ ] Install Chrome extension: Web Developer Toolbar
- [ ] Install Ruby Version Manager (RVM) – https://rvm.io/
- [ ] Install Ruby latest
- [ ] Install Jekyll (ruby Gem) – http://jekyllrb.com
- [ ] Create an account at https://github.com
- [ ] Install git
View nodejs-cheatsheet.js
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@StevenBlack
StevenBlack / better-nodejs-require-paths.md
Created Sep 23, 2016 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js
View better-nodejs-require-paths.md

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@StevenBlack
StevenBlack / crosstab.sql
Created May 12, 2016 — forked from romansklenar/crosstab.sql
PostgreSQL "pivot table" example using tablefunc extension
View crosstab.sql
CREATE EXTENSION tablefunc;
CREATE TABLE sales(year int, month int, qty int);
INSERT INTO sales VALUES(2007, 1, 1000);
INSERT INTO sales VALUES(2007, 2, 1500);
INSERT INTO sales VALUES(2007, 7, 500);
INSERT INTO sales VALUES(2007, 11, 1500);
INSERT INTO sales VALUES(2007, 12, 2000);
INSERT INTO sales VALUES(2008, 1, 1000);
INSERT INTO sales VALUES(2009, 5, 2500);
You can’t perform that action at this time.