Skip to content

Commit 61f715b

Browse files
committed
add ?censor and ?safe params so we can use it at work
enabling everyone to shit up their workplaces :D
1 parent 826905b commit 61f715b

File tree

8 files changed

+210
-68
lines changed

8 files changed

+210
-68
lines changed

README.markdown

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Some interesting usage for that can be:
1515
git config --global alias.yolo '!git commit -m "$(curl -s https://whatthecommit.com/index.txt)"'
1616
```
1717

18+
## Make it safe for work
19+
20+
https://whatthecommit.com/?safe filters out any unsafe or swearing messages
21+
https://whatthecommit.com/?censor censors them instead, and filters messages that wouldn't be funny if censored
22+
https://whatthecommit.com/?censor=* censors using custom pattern
23+
1824
Or use one of the following VSCode Extensions:
1925

2026
- [WhatTheCommit](https://marketplace.visualstudio.com/items?itemName=Gaardsholt.vscode-whatthecommit)

commit.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@
1414

1515
class MainHandler(tornado.web.RequestHandler):
1616
def get(self, message_hash=None):
17-
found_message = messages.find_by_md5(message_hash)
17+
safe_only = self.get_argument("safe", default=False) != False
18+
censor = self.get_argument("censor", default=False)
19+
if censor == "":
20+
censor = True
21+
22+
found_message = messages.find_by_md5(message_hash, censor=censor)
1823

1924
if message_hash and not found_message:
2025
raise tornado.web.HTTPError(404)
2126

2227
if found_message:
2328
self.output_message(found_message, message_hash)
2429
else:
25-
message, generated_message_hash = messages.generate()
30+
message, generated_message_hash = (
31+
messages.generate(safe_only=safe_only, censor=censor))
2632
self.output_message(message, generated_message_hash)
2733

2834
def output_message(self, message, message_hash):

commit_messages/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
these are the source text files from which all the commit messages
2+
are generated
3+
4+
- put commit messages with swear words in censorable.txt, this makes
5+
them funny by using [grawlixes](https://en.wikipedia.org/wiki/Grawlix)
6+
7+
- put other nsfw in unsafe, because they cannot be made funny and safe
8+
by using grawlixes
9+
10+
- put safe for work messages in safe.txt.
11+
12+
## Script for filtering of swear words
13+
14+
This was used to create the initial list of unsafe words.
15+
16+
```py
17+
BAD_WORDS = [
18+
"shit",
19+
"piss",
20+
"fuck",
21+
"cunt",
22+
"cocksucker",
23+
"motherfucker",
24+
"tits",
25+
26+
"cock",
27+
"fucker",
28+
29+
"fart",
30+
"turd",
31+
"twat",
32+
33+
"dicksucker",
34+
"fucking",
35+
36+
"sex",
37+
"sexy",
38+
]
39+
40+
safe_f = open("commit_messages/safe.txt", "w")
41+
unsafe_f = open("commit_messages/unsafe.txt", "w")
42+
43+
with open("./commit_messages.txt") as original_f:
44+
for line in original_f:
45+
bad = False
46+
47+
for bad_word in BAD_WORDS:
48+
if bad_word in line.lower():
49+
bad = True
50+
51+
if bad:
52+
unsafe_f.write(line)
53+
else:
54+
safe_f.write(line)
55+
56+
safe_f.close()
57+
unsafe_f.close()
58+
```

commit_messages/censorable.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"Get that shit outta my master."
2+
Code was clean until manager requested to fuck it up
3+
Derp search/replace fuckup
4+
Either Hot Shit or Total Bollocks
5+
FUCKING XUPPERNAMEX
6+
Fixed some shit
7+
Fixed the fuck out of #XNUMX!
8+
Fuck it, YOLO!
9+
Fucking egotistical bastard. adds expandtab to vimrc
10+
Fucking submodule bull shit
11+
Fucking templates.
12+
Herping the fucking derp right here and now.
13+
I don't get paid enough for this shit.
14+
I hate this fucking language.
15+
I'm too old for this shit!
16+
It fucking compiles \:D/
17+
Merge pull request #67 from Lazersmoke/fix-andys-shit Fix andys shit
18+
My boss forced me to build this feature... Pure shit.
19+
REALLY FUCKING FIXED
20+
Revert "fuckup".
21+
SHIT ===> GOLD
22+
SOAP is a piece of shit
23+
Shit code!
24+
Some shit.
25+
WHO THE FUCK CAME UP WITH MAKE?
26+
Why The Fuck?
27+
a lot of shit
28+
clarify further the brokenness of C++. why the fuck are we using C++?
29+
fix some fucking errors
30+
fixed shit that havent been fixed in last commit
31+
fixing project shit
32+
fuckup.
33+
holy shit it's functional
34+
if you're not using et, fuck off
35+
include shit
36+
refuckulated the carbonator
37+
someday I gonna kill someone for this shit...
38+
this is how we generate our shit.
39+
I don't give a damn 'bout my reputation
40+
arrgghh... damn this thing for not working.
41+
download half the damn internet to parse a pdf
42+
fix that damn sign!!!
43+
hopefully going to get a successful build got damn it
44+
still trying to render a damn cube

0 commit comments

Comments
 (0)