Skip to content

Instantly share code, notes, and snippets.

View aenoble's full-sized avatar
:shipit:

Andrew Noble aenoble

:shipit:
  • Hamilton, Ontario.
View GitHub Profile
@aenoble
aenoble / day1.js
Last active December 10, 2020 18:25
AOC 2020
const input = ``;
const inputs = input.split("\n").map(i => parseInt(i, 10));
// Part 1
inputs.forEach(i => {
inputs.forEach(j => {
if (i+j==2020) console.log(i*j);
});
});
@aenoble
aenoble / email.md
Last active July 8, 2020 21:40
Email from owner of CTRL-V re: Canadian government small business relief

Most of Ontario's Small Businesses Will Be Permanently Closed By the End of 2020 My name is Ryan Brooks. I am the CEO and co-founder of Ctrl V, the world's first virtual reality arcade, started in Waterloo, Ontario on June 1, 2016.

If you are receiving this email, it means that you or someone you know has attended one of our Ontario arcades since that time.

Regardless, on behalf of all Ctrl V locations, I'd like to start by apologizing in advance for the fact that a company like ours has to even send out an email of this nature.

We are not reaching out to sell you anything.

sum(
if ([news_b1] = 99, 1, [news_b1]),
if ([news_b2] = 99, 1, [news_b2]),
if ([news_b3] = 99, 1, [news_b3]),
if ([news_b4] = 99, 1, [news_b4]),
if ([news_b5] = 99, 1, [news_b5]),
if ([news_b6] = 99, 1, [news_b6]),
if ([news_b7] = 99, 1, [news_b7]),
if ([news_b8] = 99, 1, [news_b8]),
if ([news_b9] = 99, 1, [news_b9]),
@aenoble
aenoble / tmux.conf
Created February 13, 2018 18:15 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@aenoble
aenoble / gist:9eea250d5b3a17ee17b2aac3634e6511
Last active September 19, 2017 15:46
Drop db connections because I always forget how.
#https://stackoverflow.com/a/5109190
SELECT
pg_terminate_backend(pid)
FROM
pg_stat_activity
WHERE
pid <> pg_backend_pid()
AND datname = 'database_name';
@aenoble
aenoble / postgresql_9.1_to_9.3_on_ubuntu_12.04
Last active June 20, 2017 15:36 — forked from mdpatrick/postgresql_9.1_to_9.3_on_ubuntu_12.04
Upgrade PostgreSQL from 9.1 to 9.3 on Ubuntu 12.04
# Probably excessive, but it makes these instructions simpler
sudo -i
# Add postgresql repo and update apt listing
echo "deb http://apt.postgresql.org/pub/repos/apt/ squeeze-pgdg main" > /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
apt-get update
# For some reason this is necessary with PostgreSQL on Ubuntu 12.04
update-alternatives --remove postmaster.1.gz /usr/share/postgresql/9.1/man/man1/postmaster.1.gz
andrew:~ $ python
Python 2.7.3 (default, Mar 29 2013, 15:55:26)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.27)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 87 * 0.2
17.400000000000002
>>>AAAMACEAAAADAwYAAAAEAAAAY29hbAMDAgoAAABjb3BwZXItb3Jl
AwMCCQAAAGNydWRlLW9pbAMDAgoAAABlbmVteS1iYXNlAwMCCAAAAGl
yb24tb3JlAwMCBQAAAHN0b25lAwMCzrtq6nZdAACZsgAAAAAAAAAAAA
ADABnsHcw=<<<

Keybase proof

I hereby claim:

  • I am aenoble on github.
  • I am aenoble (https://keybase.io/aenoble) on keybase.
  • I have a public key whose fingerprint is 5202 076F 6E43 C3A8 5CEC 7520 1F95 26B6 D479 6FCA

To claim this, I am signing this object:

@aenoble
aenoble / 1_summary.md
Last active November 3, 2015 20:17
HT/LS Standings "Streaks" changes.

There's embedded HTML in the "stkoverall", "stkhome", and "stkaway" views of the Standings feed that doesn't have equivalent plaintext representations.

eg: http://cluster.leaguestat.com/feed/?feed=modulekit&view=statviewtype&type=standings&key=c680916776709578&fmt=json&client_code=whl&lang=&season_id=251&stat=stkoverall&fmt=json

I need that to be changed so everything in one of those HTML-strings is separated out. I'm including two JSON snippets that have the current and desired views so you can see the difference. Note: the "start_date" and "end_date" fields are now ISO 8601 representations of a particular date.

Let me know if you have any questions.