Skip to content

Instantly share code, notes, and snippets.

I'd like to add you to my professional network on GitHub.

Peter Bhat Harkins pushcx

I'd like to add you to my professional network on GitHub.
Block or report user

Report or block pushcx

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
pushcx / .irssi-config.autosave
Created Jan 21, 2020
irssi config for too many buffers
View .irssi-config.autosave
keyboard = (
{ key = "meta-p"; id = "change_window"; data = "20"; },
{ key = "meta-a"; id = "change_window"; data = "21"; },
{ key = "meta-s"; id = "change_window"; data = "22"; },
{ key = "meta-d"; id = "change_window"; data = "23"; },
{ key = "meta-f"; id = "change_window"; data = "24"; },
{ key = "meta-g"; id = "change_window"; data = "25"; },
{ key = "meta-h"; id = "change_window"; data = "26"; },
{ key = "meta-j"; id = "change_window"; data = "27"; },
{ key = "meta-k"; id = "change_window"; data = "28"; },
View page.css
.outer {
display: grid;
gap: 1em;
/* may be a bug with width=600px windows here, I'm bad at responsive */
@media (min-width: 600px) {
.outer {
grid-template-cols: 1fr 1fr;
background-color: #eee;
pushcx / log
Last active Nov 13, 2019
query explains for perf analysis
View log
# rails console to collect queries:
irb(main):001:0> u = User.find_by(username: 'pushcx');nil
D, [2019-10-02T14:04:06.531843 #12101] DEBUG -- : (0.6ms) SET NAMES utf8mb4, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
D, [2019-10-02T14:04:06.546456 #12101] DEBUG -- : User Load (1.0ms) SELECT `users`.* FROM `users` WHERE `users`.`username` = 'pushcx' LIMIT 1
=> nil
irb(main):002:0> Comment.for_user(u).order("id DESC").includes(:user, :hat, :story => :user).joins(:story).where.not(stories: { is_expired: true }).limit(20) .offset((1 - 1) * 20);nil
D, [2019-10-02T14:05:35.270496 #12101] DEBUG -- : Comment Load (4609.9ms) SELECT `comments`.* FROM `comments` INNER JOIN `stories` ON `stories`.`id` = `comments`.`story_id` WHERE `stories`.`is_expired` != TRUE ORDER BY id DESC LIMIT 11 OFFSET 0
D, [2019-10-0
pushcx / merged.tsv
Created Sep 21, 2019
all merged stories on lobsters
View merged.tsv
link title Heartbleed Bug (OpenSSL CVE-2014-0160) LibreSSL Will be Portable BSDCan 2014: Bob Beck on LibreSSL: the first 30 days, and where we go from here First release of LibreSSL portable is available Crossing Streams: a Love Letter to io.Reader Watch That Windows Update: FTDI Drivers Are Killing Fake Chips Microsoft Open Sources .NET and Mono Habitat – Home Automation for Products You Already Own (my First KS) Violating randomization standards
pushcx /
Created Jun 22, 2018
2018-06-22 lobsters activity stats

I was asked a couple Lobsters stats questions and wanted to paste the answers both because there was some detail and because I might as well share the numbers with more than just the submitter. The policy is that I'm happy to answer questions or run queries as long as they don't create a lot of work for me or a worst-of list.

schema if you want to write queries: might be interesting for some recent stats

  1. roughly how many people visit each day/month

Weekdays I see typically 12-15k unique IPs, so probably a a few more visitors than that to account for shared wifi like coffeshops and coworkers. I think weekends are around half that. I haven't kept a close eye on this because it wouldn't have changed any decision I've made (

pushcx / gist:c48f1527f23f46c2bee76e79844c53eb
Last active May 23, 2018
Lobsters stats on story hiding
View gist:c48f1527f23f46c2bee76e79844c53eb
| n_hidings | n_stories |
| 0 | 19866 |
| 1 | 13070 |
| 2 | 5728 |
| 3 | 1992 |
| 4 | 797 |
| 5 | 384 |
| 6 | 205 |
pushcx /
Last active Oct 25, 2017
Lobsters migration checklist

2017-10-25: this few open items of this checklist has been migrated to issues on the ansible repo for better visibility and tracking. This gist is left up in the hopes it's useful for anyone setting up their own site using the lobsters codebase.


  • announce migration + privacy on twitter
  • Lobsters post: this checklist, privacy deadline, migration date
  • post this plan to lobsters
  • transfer registration to pushcx
  • transfer @lobsters twitter account to pushcx
pushcx /
Last active Aug 16, 2017
polite "please stop spamming lobsters" message

I've had a 100% positive response rate sending this to people who see Lobsters as a good place to dump content marketing. Please feel free to take it and use it to help guide people to good behavior.


Hey folks,

I’ve liked the articles you’ve written and submitted to Lobsters, thanks for sharing good posts.

A good rule of thumb is that at most half of your submissions and comments should be on your own stuff. Otherwise folks will take your participation as one-way exploitation and start flagging all your stories as spam. Hope this helps, and I look forward to seeing you around the site.

View bindingofcallerkludge.rb
require 'binding_of_caller'
class ReallyParticularInsantiation
def initialize
b = binding.of_caller(1)
# could also b.eval to get at __FILE__ and __LINENO__
if b.eval('self.class') != Foo or b.eval('__method__') != :try
raise RuntimeError, "I don't even know what to call this coupling"
You can’t perform that action at this time.