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
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
pushcx / log
Last active Nov 13, 2019
query explains for perf analysis
View log
context: https://lobste.rs/s/5hshvd/proposal_lobste_rs_performance_analysis#c_bp5fdv
# 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
pushcx / merged.tsv
Created Sep 21, 2019
all merged stories on lobsters
View merged.tsv
link title
https://lobste.rs/s/kqnxqr Heartbleed Bug (OpenSSL CVE-2014-0160)
https://lobste.rs/s/hvykz9 LibreSSL Will be Portable
https://lobste.rs/s/vraf4g BSDCan 2014: Bob Beck on LibreSSL: the first 30 days, and where we go from here
https://lobste.rs/s/0leenb First release of LibreSSL portable is available
https://lobste.rs/s/bmiu9s Crossing Streams: a Love Letter to io.Reader
https://lobste.rs/s/fi1h79 Watch That Windows Update: FTDI Drivers Are Killing Fake Chips
https://lobste.rs/s/pl0wwu Microsoft Open Sources .NET and Mono
https://lobste.rs/s/kz4gaj Habitat – Home Automation for Products You Already Own (my First KS)
https://lobste.rs/s/acvc2l Violating randomization standards
@pushcx
pushcx / stats.md
Created Jun 22, 2018
2018-06-22 lobsters activity stats
View stats.md

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: https://github.com/lobsters/lobsters/blob/master/db/schema.rb

https://lobste.rs/s/cqnzl5/lobste_rs_access_pattern_statistics_for 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 (https://push.cx/2015/will-knowledge-change-a-decision-you-make).

@pushcx
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
pushcx / migration.md
Last active Oct 25, 2017
Lobsters migration checklist
View migration.md

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.

Prep

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

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'
# https://twitter.com/garybernhardt/status/875037876215357440
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.