Skip to content

Instantly share code, notes, and snippets.

View chrisquinnr's full-sized avatar

Chris Quinn chrisquinnr

View GitHub Profile
@chrisquinnr
chrisquinnr / postgres-cheatsheet.md
Created October 14, 2019 12:32 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -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)
chris @ ~/Sites/_My Projects/meteor-ci * cq
master
[19] → git commit -am 'bad commit'
/Users/chris/Sites/_My Projects/meteor-ci/imports/ui/layouts/body/body.js
1:21 error Missing semicolon semi
✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the `--fix` option.
(function() {
var apiURL, recentNotificationsURL;
var title = "Breaking News";
var icon = "https://www.washingtonpost.com/wp-stat/desktop-notifications/icons/wp-icon-108.png";
var Notifications = "push_notifications";
var hasActiveNotification = false;
recentNotificationsURL = "https://device-reg.wpdigital.net/pushv2/messages/recent?pushApp\x3dDESKTOP_ALERTS\x26days\x3d1";
self.addEventListener("install", function(event) {
self.skipWaiting();
console.log("Installed", event)
@chrisquinnr
chrisquinnr / hosts
Created July 3, 2017 07:48 — forked from eyecatchup/hosts
Disable Skype ads: 1.) Add hosts to your hosts file 2.) Flush DNS resolver cache (ipconfig /flushdns)
# Block Skype ads
127.0.0.1 *.msads.net
127.0.0.1 *.msecn.net
127.0.0.1 *.rad.msn.com
127.0.0.1 a.ads2.msads.net
127.0.0.1 ac3.msn.com
127.0.0.1 ad.doubleclick.net
127.0.0.1 adnexus.net
127.0.0.1 adnxs.com
127.0.0.1 ads1.msn.com
@chrisquinnr
chrisquinnr / handler.js
Created June 14, 2017 10:08
Serverless function to grab cryptocurrency price data and post to Slack
'use strict';
const apiURL = 'https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=BTC,USD,GBP,ETH';
module.exports.definition = { BTC: 0.1387, USD: 378.43, GBP: 302, ETH: 1 };
module.exports.run = ( mock = false ) => {
const time = new Date();
this.runCryptoCurrencyChecker(mock, time);
console.log(`CryptoTracker ran at ${time}`);
@chrisquinnr
chrisquinnr / README-Template.md
Created April 5, 2017 08:46 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@chrisquinnr
chrisquinnr / pre-commit.sh
Created April 5, 2017 08:41 — forked from czardoz/pre-commit.sh
Git pre-commit hook that checks for AWS keys
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
EMPTY_TREE=$(git hash-object -t tree /dev/null)
against=$EMPTY_TREE
fi
meteor create --bare chimp-testing
cd chimp-testing meteor
@chrisquinnr
chrisquinnr / linden.js
Created April 6, 2016 08:03
Engine behind xkcd 1663
!function (t) {
function e(i) {
if (n[i])return n[i].exports;
var o = n[i] = {exports: {}, id: i, loaded: !1};
return t[i].call(o.exports, o, o.exports, e), o.loaded = !0, o.exports
}
var n = {};
return e.m = t, e.c = n, e.p = "", e(0)
}([function (t, e, n) {
@chrisquinnr
chrisquinnr / restore.txt
Created January 26, 2016 15:13
mupx mongorestore
1) Copy dump folder to server
scp -r /local_path/to/dump_folder root@111.222.33.4:/remote/path
2) SSH into server
ssh root@111.222.33.4
3) Copy from root of server to inside docker container