Compare commits
7 Commits
update-set
...
lighthouse
Author | SHA1 | Date | |
---|---|---|---|
9412bbdf5a
|
|||
1c5be8c90a
|
|||
2f90ca2d5d
|
|||
a83f1858e2
|
|||
c11751c306
|
|||
2f11d30baf
|
|||
338746e1f3
|
17
.github/workflows/audit.yml
vendored
@ -2,6 +2,8 @@ name: Audit
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -16,7 +18,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout (pull_request)
|
- name: Checkout (pull_request)
|
||||||
if: github.event.pull_request
|
if: github.event.pull_request
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@ -24,7 +26,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout (push)
|
- name: Checkout (push)
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@ -35,7 +37,7 @@ jobs:
|
|||||||
hugo --printI18nWarnings --printPathWarnings --baseURL https://localhost -d old/
|
hugo --printI18nWarnings --printPathWarnings --baseURL https://localhost -d old/
|
||||||
|
|
||||||
- name: Checkout current commit
|
- name: Checkout current commit
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@ -66,13 +68,12 @@ jobs:
|
|||||||
urls="${urls//'%'/'%25'}"
|
urls="${urls//'%'/'%25'}"
|
||||||
urls="${urls//$'\n'/'%0A'}"
|
urls="${urls//$'\n'/'%0A'}"
|
||||||
urls="${urls//$'\r'/'%0D'}"
|
urls="${urls//$'\r'/'%0D'}"
|
||||||
echo "urls=$urls" >> $GITHUB_OUTPUT
|
echo "::set-output name=urls::$urls"
|
||||||
|
|
||||||
- name: Install Caddy
|
- name: Install Caddy
|
||||||
if: "${{ steps.changed_urls.outputs.urls != '' }}"
|
if: "${{ steps.changed_urls.outputs.urls != '' }}"
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install caddy
|
sudo apt install caddy
|
||||||
@ -91,7 +92,7 @@ jobs:
|
|||||||
runs: 3
|
runs: 3
|
||||||
serverBaseUrl: https://lhci.bbaovanc.com/
|
serverBaseUrl: https://lhci.bbaovanc.com/
|
||||||
# this should be safe since it only allows adding (not deleting) data
|
# this should be safe since it only allows adding (not deleting) data
|
||||||
serverToken: 2fca0410-95ae-4ea9-8dc6-687ed7843a3a
|
serverToken: 926a24f2-90e4-48b1-809f-055b9408cf4b
|
||||||
urls: ${{ steps.changed_urls.outputs.urls }}
|
urls: ${{ steps.changed_urls.outputs.urls }}
|
||||||
|
|
||||||
|
|
||||||
@ -99,7 +100,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
2
.github/workflows/deploy.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
url: https://bbaovanc.com
|
url: https://bbaovanc.com
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
3
.github/workflows/pull_request.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@ -91,4 +91,5 @@ jobs:
|
|||||||
A preview of this pull request is ready!
|
A preview of this pull request is ready!
|
||||||
See it at https://demo.bbaovanc.com/pull_request/${{ github.event.number }}/
|
See it at https://demo.bbaovanc.com/pull_request/${{ github.event.number }}/
|
||||||
View the deploy log at https://github.com/BBaoVanC/bbaovanc.com/actions/runs/${{ github.run_id}}
|
View the deploy log at https://github.com/BBaoVanC/bbaovanc.com/actions/runs/${{ github.run_id}}
|
||||||
|
Please note that currently the comment system is only operational on real deploys on bbaovanc.com. If you see an error, it's probably not your fault.
|
||||||
edit-mode: replace
|
edit-mode: replace
|
||||||
|
@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
## Where to put questions/issues/etc
|
## Where to put questions/issues/etc
|
||||||
|
|
||||||
Use the [GitHub Discussions forum][github-discussions-url] for any questions,
|
Please use the [proper section on
|
||||||
or ideas. Use the "Q&A" section for both questions and issues as well.
|
bobaforum](https://forum.bbaovanc.com/t/my-website) for issues, questions, or
|
||||||
|
discussions.
|
||||||
[github-discussions-url]: https://github.com/BBaoVanC/bbaovanc.com/discussions
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
|
@ -4,5 +4,5 @@ My personal website, generated using [Hugo](https://gohugo.io)
|
|||||||
|
|
||||||
## Discussions
|
## Discussions
|
||||||
|
|
||||||
Use [GitHub Discussions](https://github.com/BBaoVanC/bbaovanc.com/discussions)
|
Use [bobaforum](https://forum.bbaovanc.com) for questions, ideas, discussions,
|
||||||
for questions, ideas, discussions, etc. relating to me or my website.
|
etc. relating to me or my website.
|
||||||
|
@ -1,120 +0,0 @@
|
|||||||
/* Isso styling */
|
|
||||||
h4.isso-thread-heading {
|
|
||||||
color: var(--text-0);
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-comment:not(:first-of-type),
|
|
||||||
.isso-follow-up .isso-comment {
|
|
||||||
border-color: var(--background-3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-author,
|
|
||||||
.isso-page-author-suffix,
|
|
||||||
.isso-comment-footer,
|
|
||||||
.isso-comment-footer .isso-votes {
|
|
||||||
color: var(--text-gray-0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-comment-header .isso-spacer,
|
|
||||||
.isso-spacer:hover,
|
|
||||||
.isso-permalink,
|
|
||||||
.isso-permalink:hover {
|
|
||||||
color: var(--text-gray-1) !important;
|
|
||||||
}
|
|
||||||
a.isso-author:hover,
|
|
||||||
.isso-permalink:hover {
|
|
||||||
text-decoration: underline !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-comment.isso-is-page-author > .isso-text-wrapper {
|
|
||||||
background-color: var(--background-accent-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-feedlink:hover,
|
|
||||||
.isso-reply {
|
|
||||||
color: var(--link-0) !important;
|
|
||||||
text-shadow: unset !important;
|
|
||||||
}
|
|
||||||
.isso-reply:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-text pre,
|
|
||||||
.isso-text :not(pre) > code {
|
|
||||||
background-color: var(--background-2);
|
|
||||||
border: none;
|
|
||||||
padding: 2px 4px;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-input-wrapper input,
|
|
||||||
.isso-post-action > input,
|
|
||||||
.isso-textarea,
|
|
||||||
.isso-preview {
|
|
||||||
color: var(--text-1);
|
|
||||||
background-color: var(--background-1);
|
|
||||||
border-color: var(--background-2) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-input-wrapper input:focus,
|
|
||||||
.isso-textarea:focus {
|
|
||||||
border-color: var(--background-3) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-post-action > input:hover {
|
|
||||||
background-color: var(--background-2);
|
|
||||||
}
|
|
||||||
.isso-post-action > input:focus,
|
|
||||||
.isso-post-action > input:active {
|
|
||||||
background-color: var(--background-3);
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-textarea {
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
.isso-input-wrapper {
|
|
||||||
display: inline-flex;
|
|
||||||
flex-direction: column;
|
|
||||||
margin-right: 4px;
|
|
||||||
max-width: 25%;
|
|
||||||
}
|
|
||||||
.isso-input-wrapper input {
|
|
||||||
order: 1;
|
|
||||||
}
|
|
||||||
.isso-input-wrapper label {
|
|
||||||
order: 2;
|
|
||||||
font-size: small;
|
|
||||||
}
|
|
||||||
.isso-post-action {
|
|
||||||
margin-left: 4px;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
.isso-input-wrapper {
|
|
||||||
display: block;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media print {
|
|
||||||
.comments {
|
|
||||||
break-before: always;
|
|
||||||
}
|
|
||||||
.isso-comment {
|
|
||||||
max-width: unset;
|
|
||||||
}
|
|
||||||
.isso-text-wrapper {
|
|
||||||
break-inside: avoid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-postbox,
|
|
||||||
.isso-feedlink {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.isso-target {
|
|
||||||
animation: target-fade 10s ease-out; /* defined in bobatheme */
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
diff -qrNtbB old/ new/ |
|
diff -qrN old/ new/ |
|
||||||
grep -oP '(?<=\s)new\/\S*' |
|
grep -oP '(?<=\s)new\/\S*' |
|
||||||
xargs -d '\n' ls -1d 2>/dev/null |
|
xargs -d '\n' ls -1d 2>/dev/null |
|
||||||
grep 'index.html$' |
|
grep 'index.html$' |
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
baseURL: https://bbaovanc.com
|
baseURL: https://bbaovanc.com
|
||||||
theme: bobatheme
|
theme: bobatheme
|
||||||
defaultContentLanguage: en
|
defaultContentLanguage: en
|
||||||
copyright: '© 2021-2023 bbaovanc <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>'
|
copyright: '© 2021 bbaovanc <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>'
|
||||||
sectionPagesMenu: main
|
sectionPagesMenu: main
|
||||||
enableRobotsTXT: true
|
enableRobotsTXT: true
|
||||||
paginate: 10
|
paginate: 10
|
||||||
@ -59,7 +59,7 @@ params:
|
|||||||
print: true
|
print: true
|
||||||
|
|
||||||
# show "Latest Posts" section at bottom of content pages
|
# show "Latest Posts" section at bottom of content pages
|
||||||
# latestPostsOnContent: true
|
latestPostsOnContent: true
|
||||||
|
|
||||||
|
|
||||||
footer: >-
|
footer: >-
|
||||||
@ -79,6 +79,10 @@ languages:
|
|||||||
weight: 1
|
weight: 1
|
||||||
menu:
|
menu:
|
||||||
main:
|
main:
|
||||||
|
- identifier: forum
|
||||||
|
name: Forum
|
||||||
|
url: https://forum.bbaovanc.com
|
||||||
|
|
||||||
- identifier: status-page
|
- identifier: status-page
|
||||||
name: Status Page
|
name: Status Page
|
||||||
url: https://status.bbaovanc.com
|
url: https://status.bbaovanc.com
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
title: Authors
|
|
||||||
|
|
||||||
description: >-
|
|
||||||
List of authors on my website.
|
|
||||||
|
|
||||||
---
|
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
title: GitHub Copilot
|
title: Github Copilot
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ categories:
|
|||||||
tags:
|
tags:
|
||||||
- bobanews
|
- bobanews
|
||||||
- listmonk
|
- listmonk
|
||||||
|
- mailing-list
|
||||||
- newsletter
|
- newsletter
|
||||||
|
|
||||||
# this will be shown for the article in list pages and in the page metadata
|
# this will be shown for the article in list pages and in the page metadata
|
||||||
@ -37,11 +38,6 @@ notifications when I post new ones, so I have more than just an RSS feed.
|
|||||||
|
|
||||||
<!--more-->
|
<!--more-->
|
||||||
|
|
||||||
{{< aside warning >}}
|
|
||||||
I decided that I didn't really want to deal with the extra work of managing a
|
|
||||||
newsletter so I've removed it. (I didn't actually get any sign-ups).
|
|
||||||
{{< /aside >}}
|
|
||||||
|
|
||||||
**See the ["Signing Up" section]({{< ref "#signing-up" >}}) for instructions on
|
**See the ["Signing Up" section]({{< ref "#signing-up" >}}) for instructions on
|
||||||
how to sign up for the newsletter.**
|
how to sign up for the newsletter.**
|
||||||
|
|
||||||
@ -78,11 +74,6 @@ website uses. Here's a screenshot of how it currently looks:
|
|||||||
|
|
||||||
## Signing up
|
## Signing up
|
||||||
|
|
||||||
{{< aside warning >}}
|
|
||||||
I decided that I didn't really want to deal with the extra work of managing a
|
|
||||||
newsletter so I've removed it. (I didn't actually get any sign-ups anyways.)
|
|
||||||
{{< /aside >}}
|
|
||||||
|
|
||||||
You can sign up to get emails about new posts on the [newsletter signup form
|
You can sign up to get emails about new posts on the [newsletter signup form
|
||||||
here](https://lists.bbaovanc.com/subscription/form). Make sure the box next to
|
here](https://lists.bbaovanc.com/subscription/form). Make sure the box next to
|
||||||
the list labeled `bbaovanc.com Blog Posts` is checked. You'll need to provide an
|
the list labeled `bbaovanc.com Blog Posts` is checked. You'll need to provide an
|
||||||
|
@ -95,9 +95,9 @@ configs.
|
|||||||
### PHP (PrivateBin)
|
### PHP (PrivateBin)
|
||||||
|
|
||||||
The Caddy config for this example is the same as the [one used for
|
The Caddy config for this example is the same as the [one used for
|
||||||
bin.boba.best](https://git.boba.best/boba.best/caddy/src/commit/cd00151fbdd784979a8a181980cc36061be68c7d/conf.d/bin.boba.best).
|
bin.boba.best](https://git.boba.best/configs/caddy/src/commit/cd00151fbdd784979a8a181980cc36061be68c7d/conf.d/bin.boba.best).
|
||||||
I've stripped it down a bit by removing the [custom error
|
I've stripped it down a bit by removing the [custom error
|
||||||
pages](https://git.boba.best/boba.best/caddy/src/commit/cd00151fbdd784979a8a181980cc36061be68c7d/Caddyfile#L15-L24),
|
pages](https://git.boba.best/configs/caddy/src/commit/cd00151fbdd784979a8a181980cc36061be68c7d/Caddyfile#L15-L24),
|
||||||
[HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security), [zstd
|
[HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security), [zstd
|
||||||
compression](https://github.com/facebook/zstd), and logging.
|
compression](https://github.com/facebook/zstd), and logging.
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ server {
|
|||||||
### Reverse proxy + static files (Gitea)
|
### Reverse proxy + static files (Gitea)
|
||||||
|
|
||||||
This last example is based on
|
This last example is based on
|
||||||
[git.bbaovanc.com](https://git.bbaovanc.com/boba.best/caddy/src/commit/57c9f0011eae92ef5fa2992d99f01b0956802d64/conf.d/git.bbaovanc.com).
|
[git.bbaovanc.com](https://git.bbaovanc.com/configs/caddy/src/commit/57c9f0011eae92ef5fa2992d99f01b0956802d64/conf.d/git.bbaovanc.com).
|
||||||
Just like the last example, I've stripped off the custom error pages, HSTS, zstd
|
Just like the last example, I've stripped off the custom error pages, HSTS, zstd
|
||||||
compression, and logging.
|
compression, and logging.
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ entirely using Caddy's and Go templates![^caddy-templating]
|
|||||||
#### Error pages using HTTP Cats
|
#### Error pages using HTTP Cats
|
||||||
|
|
||||||
I use [this
|
I use [this
|
||||||
snippet](https://git.bbaovanc.com/boba.best/caddy/src/commit/57c9f0011eae92ef5fa2992d99f01b0956802d64/Caddyfile#L8-L15)
|
snippet](https://git.bbaovanc.com/configs/caddy/src/commit/57c9f0011eae92ef5fa2992d99f01b0956802d64/Caddyfile#L8-L15)
|
||||||
on both bbaovanc.com and boba.best to make custom error pages using images from
|
on both bbaovanc.com and boba.best to make custom error pages using images from
|
||||||
[HTTP Cats](https://http.cat). It uses Caddy's template support to generate some
|
[HTTP Cats](https://http.cat). It uses Caddy's template support to generate some
|
||||||
simple HTML to show the error code, name, and cat image.
|
simple HTML to show the error code, name, and cat image.
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
|
|
||||||
# this is the title it generated. not even joking
|
# this is the title it generated. not even joking
|
||||||
title: Copilot
|
title: Copilot
|
||||||
date: 2021-11-07T16:20:15-06:00
|
date: 2021-11-07T16:17:15-06:00
|
||||||
lastmod: 2021-11-07T16:20:15-06:00
|
lastmod: 2021-11-07T16:17:15-06:00
|
||||||
toc: true
|
toc: true
|
||||||
comments: true
|
comments: true
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- GitHub Copilot
|
- GitHub Copilot
|
||||||
|
- bbaovanc
|
||||||
|
|
||||||
categories:
|
categories:
|
||||||
|
|
||||||
@ -18,9 +19,6 @@ tags:
|
|||||||
series:
|
series:
|
||||||
- github-copilot-experiments
|
- github-copilot-experiments
|
||||||
|
|
||||||
_build:
|
|
||||||
list: never
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Did you know that Copilot is a command line interface for Copilot? It's a tool
|
Did you know that Copilot is a command line interface for Copilot? It's a tool
|
||||||
|
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 56 KiB |
@ -1,293 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
title: How the "Discord sex" (`s/e/x`) hack works
|
|
||||||
date: 2022-05-11T21:11:17-05:00
|
|
||||||
lastmod: 2022-05-11T21:11:17-05:00
|
|
||||||
toc: true
|
|
||||||
comments: true
|
|
||||||
|
|
||||||
authors:
|
|
||||||
- bbaovanc
|
|
||||||
|
|
||||||
categories:
|
|
||||||
- tips-and-tricks
|
|
||||||
|
|
||||||
tags:
|
|
||||||
- discord
|
|
||||||
- discord-tricks
|
|
||||||
- sed
|
|
||||||
|
|
||||||
# this will be shown for the article in list pages and in the page metadata
|
|
||||||
# it can be either an image or video (this might change in the future, however)
|
|
||||||
resources:
|
|
||||||
- name: feature
|
|
||||||
src: example.webp
|
|
||||||
title: Result after sending a GIF and then sending `s/e/x`.
|
|
||||||
|
|
||||||
- name: default-sex
|
|
||||||
src: default-sex.webp
|
|
||||||
title: Fallback image on `txnor.com`
|
|
||||||
|
|
||||||
- name: double-sex
|
|
||||||
src: double-sex.webp
|
|
||||||
title: Resulting image after typing `s/e/x` a second time.
|
|
||||||
|
|
||||||
- name: chess
|
|
||||||
src: chess.webp
|
|
||||||
title: This happens once you type `s/w/ag` after having done `s/e/x`.
|
|
||||||
|
|
||||||
- name: sword
|
|
||||||
src: sword.webp
|
|
||||||
title: This happens when you type `s/w/ord` after having done `s/e/x`.
|
|
||||||
- name: sword-atk
|
|
||||||
src: sword-atk.webp
|
|
||||||
title: This happens when you type `s/d/dATK`
|
|
||||||
- name: sword-def
|
|
||||||
src: sword-def.webp
|
|
||||||
title: This happens when you type `s/d/dDEF`
|
|
||||||
- name: sword-hug
|
|
||||||
src: sword-hug.webp
|
|
||||||
title: This happens when you type `s/d/dHUG`
|
|
||||||
- name: sword-win
|
|
||||||
src: sword-win.webp
|
|
||||||
title: Win screen on the `s/w/ord` game.
|
|
||||||
- name: sword-lose
|
|
||||||
src: sword-lose.webp
|
|
||||||
title: Lose screen on the `s/w/ord` game.
|
|
||||||
|
|
||||||
- name: 6969th
|
|
||||||
src: 6969th.webp
|
|
||||||
title: This happens on average (since it's randomized) every 6070th use.
|
|
||||||
|
|
||||||
- name: math-challenge
|
|
||||||
src: math-challenge.webp
|
|
||||||
title: Math challenge example
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
There's this trick going around on Discord recently where if you send any GIF
|
|
||||||
from Tenor, and then type `s/e/x`, then it turns it into a different meme GIF.
|
|
||||||
Here's how it works.
|
|
||||||
|
|
||||||
<!--more-->
|
|
||||||
|
|
||||||
{{< aside info >}}
|
|
||||||
Credit goes to Rebane2001 (not me) for making this trick, and setting it up on
|
|
||||||
`txnor.com`.
|
|
||||||
{{< /aside >}}
|
|
||||||
|
|
||||||
## The `sed` syntax
|
|
||||||
|
|
||||||
For operating systems based on Unix or Linux, there's usually a simple terminal
|
|
||||||
command included called [`sed`][sed-wikipedia], which is most commonly used to
|
|
||||||
run text replacement commands. Here's a very simple example of what a basic
|
|
||||||
`sed` command looks like:
|
|
||||||
|
|
||||||
[sed-wikipedia]: https://en.wikipedia.org/wiki/Sed
|
|
||||||
|
|
||||||
```bashsession
|
|
||||||
$ sed 's/hello/goodbye/'
|
|
||||||
```
|
|
||||||
|
|
||||||
Discord likely implemented this in order to appeal to
|
|
||||||
[IRC][irc-wikipedia][^irc-definition] users. Since IRC doesn't support editing
|
|
||||||
messages, it's common for people to send messages in that format to tell people
|
|
||||||
about changes to their previous message. Discord implemented this into both
|
|
||||||
their web/desktop client and their iOS app, excluding the Android app.
|
|
||||||
|
|
||||||
[irc-wikipedia]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
|
|
||||||
|
|
||||||
[^irc-definition]: IRC (Internet Relay Chat) is a simple text-based chat system.
|
|
||||||
It's a very old protocol, however its simplicity and minimalism is the main
|
|
||||||
reason people choose it. It's not very popular anymore.
|
|
||||||
|
|
||||||
Note that while real `sed` commands can get much more complicated, Discord's
|
|
||||||
implementation doesn't support those advanced features[^trailing-slash-note].
|
|
||||||
|
|
||||||
[^trailing-slash-note]: Also note that in Discord's implementation, the trailing
|
|
||||||
slash (after `goodbye`) can be ommitted (making it just `s/hello/goodbye`),
|
|
||||||
but with the real `sed` command, it's required.
|
|
||||||
|
|
||||||
{{< see-also "/blog/text-substitution-in-discord-using-sed" >}}
|
|
||||||
|
|
||||||
## What does `s/e/x` do?
|
|
||||||
|
|
||||||
When you send a GIF using the GIF picker on Discord, it actually sends the link
|
|
||||||
to the GIF, which is served by [Tenor][tenor-website]. For example, here's a GIF
|
|
||||||
sent from Tenor:
|
|
||||||
|
|
||||||
[tenor-website]: https://tenor.com
|
|
||||||
|
|
||||||
https://tenor.com/view/cat-massage-gif-24282757
|
|
||||||
|
|
||||||
Running `s/e/x` will take the first occurrence of `e` and replace it with `x`.
|
|
||||||
The link becomes the following (notice the bolded letter `x`):
|
|
||||||
|
|
||||||
[https://t**x**nor.com/view/cat-massage-gif-24282757][example-1]
|
|
||||||
|
|
||||||
[example-1]: https://txnor.com/view/cat-massage-gif-24282757
|
|
||||||
|
|
||||||
Then, all that's left to do is to buy the domain `txnor.com`, and write a simple
|
|
||||||
program to run on it. In fact, it looks like that domain was purchased purely in
|
|
||||||
order to make this trick possible[^txnor-domain-date].
|
|
||||||
|
|
||||||
[^txnor-domain-date]: According to [a quick WHOIS lookup][txnor-whois], the
|
|
||||||
domain was registered on May 3, 2022. That's the same day that [@Rebane
|
|
||||||
tweeted about the new feature][rebane-tweet] (~~going to https://txnor.com
|
|
||||||
redirects to this tweet~~ now the domain redirects to [Rebane's YouTube video
|
|
||||||
about the hack]({{< ref "#youtube-video" >}})), so I assume that this is the
|
|
||||||
only reason they bought the domain.
|
|
||||||
|
|
||||||
[txnor-whois]: https://www.whois.com/whois/txnor.com
|
|
||||||
[rebane-tweet]: https://twitter.com/rebane2001/status/1521544722875142145
|
|
||||||
|
|
||||||
## How does it display on Discord without redirecting?
|
|
||||||
|
|
||||||
When viewing any of the URLs on `txnor.com` in a normal web browser, you get
|
|
||||||
[redirected to a tweet][rebane-tweet]. However, Discord is able to display the
|
|
||||||
image without being redirected.
|
|
||||||
|
|
||||||
When Discord loads a website to generate an embed, it uses a user
|
|
||||||
agent[^user-agent-definition] (which is a little piece of text which tells the
|
|
||||||
server what your browser is) which looks something like this:
|
|
||||||
|
|
||||||
[^user-agent-definition]: If you actually care, there's a [Wikipedia
|
|
||||||
article](https://en.wikipedia.org/wiki/User_agent), and a [page on
|
|
||||||
WhatIsMyIPAddress.com](https://whatismyipaddress.com/user-agent) which also
|
|
||||||
explain what a user agent is.
|
|
||||||
|
|
||||||
```text
|
|
||||||
User-Agent: Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com/)
|
|
||||||
```
|
|
||||||
|
|
||||||
The important part here is the word `Discord`. If you visit the website with
|
|
||||||
your user agent set to anything containing `Discord`
|
|
||||||
(case-insensitive)[^discord-user-agent], then it serves the image directly.
|
|
||||||
|
|
||||||
[^discord-user-agent]: [According to the source code][user-agent-source-code],
|
|
||||||
it looks like `Intel Mac OS X 11.6; rv:92.0` also triggers the same response.
|
|
||||||
|
|
||||||
[user-agent-source-code]: https://github.com/rebane2001/txnor-server/blob/26c7c279b0b4668c8a3b061692d83c507aeac7c5/txnor.nginx#L23-L27
|
|
||||||
|
|
||||||
## Default image
|
|
||||||
|
|
||||||
If you go to any URL on `txnor.com` that doesn't fit one of the existing
|
|
||||||
patterns/games, then it returns this fallback image:
|
|
||||||
|
|
||||||
{{< figure src="default-sex" >}}
|
|
||||||
|
|
||||||
## Extra features
|
|
||||||
|
|
||||||
### Double sex
|
|
||||||
|
|
||||||
If you then run `s/e/x` a second time, then it changes to a different image:
|
|
||||||
|
|
||||||
{{< figure src="double-sex" >}}
|
|
||||||
|
|
||||||
This works in a simple way as well. The next `e` that appears in the URL is
|
|
||||||
inside `/view/`. So, after typing `s/e/x` a second time, the URL becomes:
|
|
||||||
|
|
||||||
[https://txnor.com/vi**x**w/cat-massage-gif-24282757][example-2]
|
|
||||||
|
|
||||||
[example-2]: https://txnor.com/vixw/cat-massage-gif-24282757
|
|
||||||
|
|
||||||
### Chess (`s/w/ag`)
|
|
||||||
|
|
||||||
Another cool feature is that you can play chess by typing `s/w/ag` after typing
|
|
||||||
the initial message of `s/e/x`.
|
|
||||||
|
|
||||||
{{< figure src="chess" >}}
|
|
||||||
|
|
||||||
### `s/w/ord`
|
|
||||||
|
|
||||||
If you do `s/w/ord` after `s/e/x`, then it starts a fighting game (titled
|
|
||||||
"Wumpagotchi Adventures". You can use three commands: s/d/d**ATK**,
|
|
||||||
s/d/d**DEF**, and s/d/d**HUG**.
|
|
||||||
|
|
||||||
Here are a few example images:
|
|
||||||
|
|
||||||
#### Main `s/w/ord` screen
|
|
||||||
|
|
||||||
{{< figure src="sword" >}}
|
|
||||||
|
|
||||||
#### ATK command
|
|
||||||
|
|
||||||
{{< figure src="sword-atk" >}}
|
|
||||||
|
|
||||||
#### DEF command
|
|
||||||
|
|
||||||
{{< figure src="sword-def" >}}
|
|
||||||
|
|
||||||
#### HUG command
|
|
||||||
|
|
||||||
{{< figure src="sword-hug" >}}
|
|
||||||
|
|
||||||
#### Win screen
|
|
||||||
|
|
||||||
{{< figure src="sword-win" >}}
|
|
||||||
|
|
||||||
#### Lose screen
|
|
||||||
|
|
||||||
{{< figure src="sword-lose" >}}
|
|
||||||
|
|
||||||
### 6969th Discord Sexer
|
|
||||||
|
|
||||||
If you happen to get a one in 6970 chance, it will instead return
|
|
||||||
a special image:
|
|
||||||
|
|
||||||
{{< figure src="6969th" >}}
|
|
||||||
|
|
||||||
[6969th-source]: https://github.com/rebane2001/txnor-server/blob/26c7c279b0b4668c8a3b061692d83c507aeac7c5/sex.py#L130-L133
|
|
||||||
|
|
||||||
Here's a [snippet of the code that handles this chance][6969th-source]:
|
|
||||||
|
|
||||||
```python
|
|
||||||
# 6969th winner image (disable for chess)
|
|
||||||
if random.randint(0, 6969) == 6969 and "ag" not in name:
|
|
||||||
web.header('Cache-Control', 'no-store')
|
|
||||||
return six_nine
|
|
||||||
```
|
|
||||||
|
|
||||||
I believe it's supposed to be a 1/6969 chance, but `random.randint` in Python
|
|
||||||
[includes both numbers][randint-inclusive]. That means that the possible numbers that it could pick
|
|
||||||
would be 0, 1, ... 6968, 6969. If you were to count the numbers included in that
|
|
||||||
sequence, it would total 6970.
|
|
||||||
|
|
||||||
[randint-inclusive]: https://docs.python.org/3/library/random.html#random.randint
|
|
||||||
|
|
||||||
### Math challenge
|
|
||||||
|
|
||||||
Any URL that matches [this regular expression][math-challenge-regex] will
|
|
||||||
instead return a randomized math challenge:
|
|
||||||
|
|
||||||
[math-challenge-regex]: https://regex101.com/r/ddEkML/1
|
|
||||||
|
|
||||||
{{< figure src="math-challenge" >}}
|
|
||||||
|
|
||||||
What's special is that the math challenge is [set to not be
|
|
||||||
cached][math-challenge-caching].
|
|
||||||
|
|
||||||
[math-challenge-caching]: https://github.com/rebane2001/txnor-server/blob/26c7c279b0b4668c8a3b061692d83c507aeac7c5/sex.py#L137
|
|
||||||
|
|
||||||
How it works is that when each person's Discord client sends a request to the
|
|
||||||
Discord CDN to get the image, the client caches that image. That means each
|
|
||||||
client will see the same challenge problem, even if the user restarts the
|
|
||||||
client. But separate clients will not have it cached, so they'll request it
|
|
||||||
again themselves, and different numbers will be generated.
|
|
||||||
|
|
||||||
## Discord sex is open source
|
|
||||||
|
|
||||||
Thanks to a [comment from Rebane on this post](#isso-16), I now know that the
|
|
||||||
server running on `txnor.com` is open source. See
|
|
||||||
[rebane2001/txnor-server][txnor-server-github].
|
|
||||||
|
|
||||||
[txnor-server-github]: https://github.com/rebane2001/txnor-server
|
|
||||||
|
|
||||||
## YouTube video
|
|
||||||
|
|
||||||
Rebane also [made a YouTube video][txnor-youtube-video] about this trick. Make
|
|
||||||
sure to check it out too!
|
|
||||||
|
|
||||||
[txnor-youtube-video]: https://www.youtube.com/watch?v=km8CR-fdB7o
|
|
||||||
|
|
||||||
I changed the page yay
|
|
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 47 KiB |
@ -35,11 +35,6 @@ to any location inside the message.
|
|||||||
|
|
||||||
<!--more-->
|
<!--more-->
|
||||||
|
|
||||||
{{< aside note >}}
|
|
||||||
This trick only works if you're on desktop/web, and will also only show to
|
|
||||||
people on desktop/web.
|
|
||||||
{{< /aside >}}
|
|
||||||
|
|
||||||
## Tutorial
|
## Tutorial
|
||||||
|
|
||||||
Before you start, copy the "right-to-left embedding" character
|
Before you start, copy the "right-to-left embedding" character
|
||||||
|
@ -28,7 +28,7 @@ resources:
|
|||||||
[What is a
|
[What is a
|
||||||
URL?](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL#parameters)
|
URL?](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL#parameters)
|
||||||
by [Mozilla
|
by [Mozilla
|
||||||
Contributors](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL/contributors.txt)
|
Contributors](https://developer.mozilla.org/en-US/docs/MDN/About/contributors.txt)
|
||||||
is licensed under [CC-BY-SA
|
is licensed under [CC-BY-SA
|
||||||
2.5](https://creativecommons.org/licenses/by-sa/2.5/)
|
2.5](https://creativecommons.org/licenses/by-sa/2.5/)
|
||||||
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
title: Categories
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
List of categories on my website. These are different types or styles of posts.
|
|
@ -16,5 +16,5 @@ description: >-
|
|||||||
- Email: bbaovanc@bbaovanc.com
|
- Email: bbaovanc@bbaovanc.com
|
||||||
- If needed, encrypt your email with [my PGP
|
- If needed, encrypt your email with [my PGP
|
||||||
key](https://keyserver.ubuntu.com/pks/lookup?search=bbaovanc%40bbaovanc.com&fingerprint=on&op=index)
|
key](https://keyserver.ubuntu.com/pks/lookup?search=bbaovanc%40bbaovanc.com&fingerprint=on&op=index)
|
||||||
- GitHub Discussions (Q&A):
|
- bobaforum (ask me questions publicly, I guess like a Q&A):
|
||||||
https://github.com/BBaoVanC/bbaovanc.com/discussions/categories/q-a
|
https://forum.bbaovanc.com/t/ask-me
|
||||||
|
@ -26,6 +26,7 @@ description: >-
|
|||||||
- [bbaovanc.com source code](https://github.com/BBaoVanC/bbaovanc.com)
|
- [bbaovanc.com source code](https://github.com/BBaoVanC/bbaovanc.com)
|
||||||
- [bobatheme](https://github.com/BBaoVanC/bobatheme) - theme for this
|
- [bobatheme](https://github.com/BBaoVanC/bobatheme) - theme for this
|
||||||
website
|
website
|
||||||
|
- [bobaforum](https://forum.bbaovanc.com) - my public forum
|
||||||
- [Searx Instance](https://search.bbaovanc.com/) - privacy-respecting search
|
- [Searx Instance](https://search.bbaovanc.com/) - privacy-respecting search
|
||||||
engine
|
engine
|
||||||
- [Gitea Instance](https://git.bbaovanc.com/) - mostly just mirrors of my GitHub
|
- [Gitea Instance](https://git.bbaovanc.com/) - mostly just mirrors of my GitHub
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
title: Series
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
List of series, which are sequences of closely related posts.
|
|
@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
title: Tags
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
List of tags on my website. These are specific things or ideas that I talk about
|
|
||||||
in a post.
|
|
@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
title: Query Parameters
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Query parameters are a map of fields and values after the question mark in a
|
|
||||||
URL.
|
|
||||||
|
|
||||||
<!--more-->
|
|
||||||
|
|
||||||
Optionally provide more information about the tag here. This part will only show
|
|
||||||
on the tag page, not on the tags list page.
|
|
||||||
|
|
||||||
If you delete this section, DO NOT delete the summary separator (`<!--more-->`)
|
|
||||||
or else the summary won't be shown.
|
|
@ -1,6 +1,103 @@
|
|||||||
{{ with resources.Get "css/comments.css" | fingerprint "sha512" }}
|
<!-- idk why this is even required
|
||||||
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
vim: ft=html
|
||||||
{{ end }}
|
-->
|
||||||
|
<style>
|
||||||
|
#isso-thread > h4 {
|
||||||
|
color: var(--text-1);
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#isso-root .isso-comment:not(:first-of-type),
|
||||||
|
.isso-follow-up .isso-comment {
|
||||||
|
border-color: var(--background-highlight);
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-comment > .isso-text-wrapper > .isso-comment-header .isso-author,
|
||||||
|
.isso-comment > .isso-text-wrapper > .isso-comment-header .isso-page-author-suffix,
|
||||||
|
.isso-comment > .isso-text-wrapper > .isso-comment-footer,
|
||||||
|
.isso-comment > .isso-text-wrapper > .isso-comment-footer .isso-votes {
|
||||||
|
color: var(--text-1);
|
||||||
|
opacity: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-comment.isso-is-page-author > .isso-text-wrapper {
|
||||||
|
background-color: var(--background-accent);
|
||||||
|
}
|
||||||
|
.isso-comment.isso-is-page-author > .isso-text-wrapper > .isso-comment-header > .isso-author {
|
||||||
|
color: var(--link-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-postbox > .isso-form-wrapper .isso-preview {
|
||||||
|
color: var(--text-1);
|
||||||
|
background: var(--background-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-comment > .isso-text-wrapper > .isso-comment-footer a,
|
||||||
|
.isso-comment > .isso-text-wrapper > .isso-comment-footer a:hover {
|
||||||
|
color: var(--link-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-comment > .isso-text-wrapper > .isso-comment-footer a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-postbox > .isso-form-wrapper > .isso-auth-section .isso-input-wrapper input,
|
||||||
|
.isso-postbox > .isso-form-wrapper > .isso-auth-section .isso-post-action > input,
|
||||||
|
#isso-thread .isso-textarea,
|
||||||
|
.isso-postbox > .isso-form-wrapper .isso-preview {
|
||||||
|
color: var(--text-1);
|
||||||
|
background-color: var(--background-1);
|
||||||
|
border-color: var(--background-2) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-postbox > .isso-form-wrapper > .isso-auth-section .isso-post-action > input:hover {
|
||||||
|
background-color: var(--background-2);
|
||||||
|
}
|
||||||
|
.isso-postbox > .isso-form-wrapper > .isso-auth-section .isso-post-action > input:active {
|
||||||
|
background-color: var(--background-highlight);
|
||||||
|
}
|
||||||
|
|
||||||
|
#isso-thread .isso-textarea {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.isso-postbox > .isso-form-wrapper > .isso-auth-section .isso-input-wrapper {
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
.isso-postbox > .isso-form-wrapper > .isso-auth-section .isso-input-wrapper input {
|
||||||
|
order: 1;
|
||||||
|
}
|
||||||
|
.isso-postbox > .isso-form-wrapper > .isso-auth-section .isso-input-wrapper label {
|
||||||
|
order: 2;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
.isso-postbox > .isso-form-wrapper > .isso-auth-section .isso-post-action {
|
||||||
|
margin-left: 4px;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
.isso-postbox > .isso-form-wrapper > .isso-auth-section .isso-input-wrapper {
|
||||||
|
display: block;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.comments {
|
||||||
|
break-before: always;
|
||||||
|
}
|
||||||
|
.isso-comment > .isso-text-wrapper {
|
||||||
|
break-inside: avoid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.isso-postbox,
|
||||||
|
.isso-feedlink {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<h2 style="margin-bottom: 0;">Comments</h2>
|
<h2 style="margin-bottom: 0;">Comments</h2>
|
||||||
<small>
|
<small>
|
||||||
@ -55,4 +152,4 @@
|
|||||||
src="https://isso.bbaovanc.com/js/embed.min.js">
|
src="https://isso.bbaovanc.com/js/embed.min.js">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section id="isso-thread" data-title="{{ .Title }}"></section>
|
<section id="isso-thread"></section>
|
||||||
|