Skip to content

Instantly share code, notes, and snippets.

@dancek
dancek / pacsup
Last active January 8, 2021 09:38
pacsup: what would `pacman -Syu` upgrade?
#!/bin/sh
# pacsup 0.1.0
# Copyright Hannu Hartikainen 2021
# MIT License
set -e
CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/pacsup"
if [ ! -d "$CACHE_DIR" ]; then
@dancek
dancek / telegram-web-compact.user.js
Created September 24, 2019 14:24
Slightly more usable Telegram Web
// ==UserScript==
// @name Telegram Web: compact layout
// @match https://web.telegram.org/
// @grant GM_addStyle
// @author Hannu Hartikainen
// ==/UserScript==
// Make layout wider and more compact
GM_addStyle(`
.im_page_wrap, .tg_head_split, .im_send_panel_wrap, .im_send_form {
### Keybase proof
I hereby claim:
* I am dancek on github.
* I am dancek (https://keybase.io/dancek) on keybase.
* I have a public key ASDl0UuRF1pzAT5shSeoY0qKa2Cq4ZzGJU5qnmIh1JJhyAo
To claim this, I am signing this object:
@dancek
dancek / # vim - 2018-07-12_22-57-23.txt
Created July 12, 2018 20:41
vim on macOS 10.13.5 - Homebrew build logs
Homebrew build logs for vim on macOS 10.13.5
Build date: 2018-07-12 22:57:23
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 92 10 0b 03 03 19 00 09 03 52 01 08 0c 00 3e 00 ??????.??R???.>.
10: 69 78 69 30 69 11 20 89 00 05 3c 3c 00 f0 83 01 ixi0i? ?.?<<.???
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 0f 11 45 00 ............??E.
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
70: 00 00 00 00 00 80 ce 02 11 30 b1 5b 13 a1 0e 59 .....????0?[???Y
80: 4d 34 37 31 42 35 32 37 33 43 48 30 2d 43 48 39 M471B5273CH0-CH9
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 92 10 0b 03 03 19 00 09 03 52 01 08 0c 00 3e 00 ??????.??R???.>.
10: 69 78 69 30 69 11 20 89 00 05 3c 3c 00 f0 83 01 ixi0i? ?.?<<.???
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 0f 11 45 00 ............??E.
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
70: 00 00 00 00 00 80 ce 02 11 30 b1 5b 13 a1 0e 59 .....????0?[???Y
80: 4d 34 37 31 42 35 32 37 33 43 48 30 2d 43 48 39 M471B5273CH0-CH9
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 92 10 0b 03 03 19 00 09 03 52 01 08 0c 00 7e 00 ??????.??R???.~.
10: 69 78 69 30 69 11 20 89 00 05 3c 3c 00 f0 82 05 ixi0i? ?.?<<.???
20: 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?...............
30: 00 00 00 00 00 00 00 00 00 00 00 00 0f 11 05 00 ............???.
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
70: 00 00 00 00 00 80 2c 0f 11 23 fb 5c 7f 1a a4 ae .....?,??#?\????
80: 31 36 4a 53 46 35 31 32 36 34 48 5a 2d 31 47 34 16JSF51264HZ-1G4
@dancek
dancek / dual_pulse_spectrum_analyzer.lua
Created July 5, 2017 12:12
SHENZHEN I/O Weekly #14: DUAL PULSE SPECTRUM ANALYZER
-- The function get_name() should return a single string that is the name of the puzzle.
--
function get_name()
return "Dual Pulse Spectrum Analyzer"
end
-- The function get_description() should return an array of strings, where each string is
-- a line of description for the puzzle. Surrounding text with asterisks will cause it to
-- be rendered in bold, something we use when mentioning a signal by name.
--
@dancek
dancek / helmet-search-from-goodreads-to-read-shelf.markdown
Created December 20, 2016 14:07
Helmet search from Goodreads to-read shelf
@dancek
dancek / responsive-fonts.less
Created November 21, 2016 18:06
Responsively resizing fonts (to keep their size near constant relative to viewport size)
.font-mediaqueries (@width-min; @width-max; @font-min; @font-max) when (@width-min < @width-max) {
@media only screen and (min-width: round(@width-min)) {
body {
font-size: @font-min;
}
}
@font-next: @font-min + 1px;
@slope: unit(@width-max - @width-min) / unit(@font-max - @font-min);
@width-next: (unit(@width-min) + @slope) * 1px;