Skip to content

Instantly share code, notes, and snippets.

View ra312's full-sized avatar
🎯
Focusing

ra312 ra312

🎯
Focusing
View GitHub Profile
@mndrix
mndrix / irc.go
Last active June 23, 2020 17:21
Family IRC server
// My small, family IRC server
//
// This file won't compile by itself because it's only one file from
// my larger family server (movie hosting, Asterisk dialplan, Git
// hosting, personal assistant, etc).
//
// Users authenticate via NICK and PASS. The USER is interpreted as a
// "device" name. That allows each user to connect from multiple
// devices simultaneously while still appearing as only one nick in
// channels. Each nick-device combo has a queue of messages which
@guyarad
guyarad / pycharm-intellisense-issues.py
Last active July 30, 2019 13:23
PyCharm issuing wrong and annoying intellisense warnings (Python 2.7.14, PyCharm 2017.3.2)
# Python 2.7.14, PyCharm 2017.3.2
from collections import defaultdict
some_default_dict = defaultdict(list)
some_default_dict[1] = 'a'
some_default_dict[2] = 'b'
some_objects = [{'id': i} for i in range(10)]
obj_by_id = {obj['id']: obj for obj in some_objects}
@kaievns
kaievns / gist:acb23149b66418ba340c
Created July 29, 2014 00:44
How to populate PostgreSQL with dummy data
CREATE TABLE t_random AS SELECT s, md5(random()::text) FROM generate_Series(1,5) s;
INSERT INTO t_random VALUES (generate_series(1,1000000000), md5(random()::text));
SELECT pg_size_pretty(pg_relation_size('t_random'));