Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Bhat Harkins pushcx

View GitHub Profile
@pushcx
pushcx / archupdate
Created Jul 24, 2022
~/.bin/archupdate
View archupdate
#!/usr/bin/env bash
# aura -C pkg -- to downgrade a package
# aura -Li pkg -- to print install/update log
# aura -Pa -- to audit PKGBUILDs (slow, s)
# aura -Qo file -- what package owns file
# aura -Ql pkg -- what files are in package
set -e # exit on error
set -o xtrace # print commands
View merged bugs.txt
$ git log --all --grep='merged'
24fa1e6a fix authored tag on merged story 1 year, 8 months ago, Peter Bhat Harkins
7a59fd95 1 + n on story domain for merged stories 1 year, 9 months ago, Peter Bhat Harkins
1a34c6ee Fix bug allowing users to vote on, hide or save merged stories. (#739) (#748) 2 years, 5 months ago, 4io
db3d6453 fix 1 + n on merged stories, even if ugly to do from a view 2 years, 7 months ago, Peter Bhat Harkins
bd1a3033 (pmueller/master) Redirect json requests for a merged story's show page (#710) 2 years, 7 months ago, Preston Mueller
13797ad1 Fix #706, properly redirect json requests for a merged story's show page 2 years, 7 months ago, Preston Mueller
6bf4a9fb fix BelongsTo rubocop warnings 2 years, 9 months ago, Thomas Dziedzic
0d7806b6 update comment count when merged into a story 2 years, 9 months ago, Preston Mueller
8a885abe (pmueller-count) Fix #683, run callbacks when updating a story's comments count, so any merged_into_story will also update. 2 years, 9 months ago
View explain.sql
> explain SELECT `replying_comments`.* FROM `replying_comments` WHERE `replying_comments`.`user_id` = 0 ORDER BY `replying_comments`.`comment_created_at` DESC LIMIT 25 OFFSET 0;
+---+---+---+---+---+---+---+---+---+---+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+---+---+---+---+---+---+---+---+---+---+
| 1 | SIMPLE | com | index | pageid | pageid | 767 | NULL | 130624 | Using index; Using temporary; Using filesort |
| 1 | SIMPLE | a | eq_ref | PRIMARY,idx_section,idx_state,idx_catid | PRIMARY | 4 | faktyp_dd.com.pageid | 1 | Using index condition; Using where |
| 1 | SIMPLE | f | eq_ref | PRIMARY | PRIMARY | 4 | faktyp_dd.a.id | 1 | Using where; Using index |
| 1 | SIMPLE | cc | eq_ref | PRIMARY | PRIMARY | 4 | faktyp_dd.a.catid | 1 | Using index condition; Using where |
| 1 | SIMPLE | c | eq_ref | PRIMARY | PRIMARY | 4 | faktyp_dd.f.content_id | 1 | Using index condition; Using where |
| 1 | SIMPLE | s | eq_ref | PRIMARY | PRIMARY | 4 | faktyp_dd.a.sectionid | 1
@pushcx
pushcx / draft.md
Created Jan 22, 2022
draft for next quarterly job posting
View draft.md

Happy new year!

Here's the template. If you have multiple positions, please post them in a single comment with --- between:

**Company:** [Name](https://example.com)

**Position(s):** Title

**Location:** City, State/Province, Country - ONSITE or REMOTE
@pushcx
pushcx / log.txt
Last active May 26, 2021
freenode takeover of #lobsters
View log.txt
2021-05-26 03:05:20 --> freenodecom (~com@freenode/staff) has joined #lobsters
2021-05-26 03:05:20 -- Mode #lobsters [+o freenodecom] by OperServ
2021-05-26 03:05:20 -- Mode #lobsters [+o freenodecom] by freenodecom
2021-05-26 03:05:20 -- freenodecom has changed topic for #lobsters from "Lobsters chat is #lobsters on irc.libera.chat - more info: https://lobste.rs/s/1z77ly/libera_chat" to "This channel has moved to ##lobsters. The topic is in violation of freenode policy: https://freenode.net/policies"
2021-05-26 03:05:20 @freenodecom This channel has been reopened with respect to the communities and new users. The topic is in violation of freenode policy: https://freenode.net/policies
2021-05-26 03:05:20 -- Mode #lobsters [-ov pushcx pushcx] by freenodecom
2021-05-26 03:05:20 -- Mode #lobsters [-sbbbb $a:Evolver *!krishdevd@111.223.27.196 *!*@78.193.195.38 *!*@177.192.231.135] by ChanServ
2021-05-26 03:05:20 -- Mode #lobsters [-bbbb *!*@177.
View comparison.txt
# old mariadb:
MariaDB [lobsters]> explain SELECT COUNT(*) FROM `replying_comments` WHERE `replying_comments`.`user_id` = 78 AND `replying_comments`.`is_unread` = TRUE;
+------+--------------------+-----------------+--------+--------------------------------------------------------------------------------------------+-------------------------------+---------+-------------------------------------------------------------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+--------------------+-----------------+--------+--------------------------------------------------------------------------------------------+-------------------------------+---------+-------------------------------------------------------------+------+-------------+
| 1 | PRIMARY |
View gist:d3b539ea66718d8ddf6f639377ac74fb
MariaDB [lobsters]> show full processlist;
+-------+----------+-----------+----------+---------+------+-------------------+---------------------------------------------------------------------+----------+
| Id | User | Host | db | Command | Time | State | Info | Progress |
+-------+----------+-----------+----------+---------+------+-------------------+---------------------------------------------------------------------+----------+
| 64327 | lobsters | localhost | lobsters | Query | 5988 | Copy to tmp table | ALTER TABLE `stories` CHANGE `score` `score` int DEFAULT 1 NOT NULL | 51.579 |
| 64463 | lobsters | localhost | lobsters | Query | 0 | Init | show full processlist | 0.000 |
+-------+----------+-----------+----------+---------+------+-------------------+---------------------------------------------------------------------+----------+
2 rows in
@pushcx
pushcx / arch.txt
Created Mar 23, 2020
notes for unbreaking arch
View arch.txt
boot from usb
setfont sun12x22
wifi-menu -o
name: 'home'
password
yes, save
netctl start home
ping google.com
View medium.txt
androiduipatterns.com
zef.me
blog.envylabs.com
hueniverse.com
blog.jelly.co
blog.coinbase.com
maori.geek.nz
techblog.appnexus.com
mondaynote.com
xato.net
View query.txt
MariaDB [lobsters]> select domain, count(*) as submitted, count(distinct stories.user_id) as submitters, (select count(*) from stories s where s.domain_id = domains.id group by s.user_id order by 1 desc limit 1) as from_one_submitter, (select count(*) from stories s where s.domain_id = domains.id group by s.user_id order by 1 desc limit 1)/count(*)*100 as submited_by_one_percentage from domains join stories on domains.id = stories.domain_id group by domain having count(*) > 5 and (from_one_submitter + 1) * 2 > count(*) order by 5 desc;
+-------------------------------------+-----------+------------+--------------------+----------------------------+
| domain | submitted | submitters | from_one_submitter | submited_by_one_percentage |
+-------------------------------------+-----------+------------+--------------------+----------------------------+
| 0xcc.re | 6 | 1 | 6 | 100.0000 |
| acha.ninja