Skip to content

Instantly share code, notes, and snippets.

View robinp's full-sized avatar

Robin Palotai robinp

  • Budapest, Hungary
View GitHub Profile
@robinp
robinp / lcd_output_decoder.c
Created June 16, 2025 00:03
LCD segment driver output decoder
// the setup routine runs once when you press reset:
void setup() {
ADCSRA &= ~(bit (ADPS0) | bit (ADPS1) | bit (ADPS2)); // clear prescaler bits
/*
ADCSRA |= bit (ADPS0); // 2
ADCSRA |= bit (ADPS1); // 4
ADCSRA |= bit (ADPS0) | bit (ADPS1); // 8
ADCSRA |= bit (ADPS2); // 16
" Generated using ChatGPT, until https://github.com/neovim/neovim/issues/28544 fix gets released.
" Put in init.vim, select visual range in terminal, and call :VCB.
" Make sure that errorformat is set well (experiment with :cexpr "path/to/file:123 etc" or your actual format and see if quickfix gets it right)
function! VisualRangeToQuickfix() abort
" Get visually selected lines
let l:start = line("'<")
let l:end = line("'>")
" Get the current buffer number
@robinp
robinp / lusta_legény.txt
Created October 13, 2023 07:04
A lusta legény (kocka mese)
Hol volt, hol nem volt, volt egyszer egy lusta legény. Naphosszat a földön
feküdt és csak bámulta az eget. Egy nap, ahogy így fekszik ott, arra száll egy
szúnyog. Markába kapja, és talán még össze is lapítja, ha a szúnyog meg nem
szólal:
- Ne bánts engem te legény! Engedj szabadon, s meglásd, jó tett helyében jót
várj!
Gondolja a legény, nézzük, mi sül ki ebből! Elengedi hát, mire ezt zizegé a kis
szúnyog:
{-# LANGUAGE CPP #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
@robinp
robinp / main.lua
Created April 13, 2020 14:07
Source for Lua+Löve game programming tutorial, part 01
print("Hello")
kartyak = 8
kartyaFelforditva = {
[1] = false,
[2] = false,
[3] = false,
[4] = false,
[5] = false,
@robinp
robinp / nixos-hydra-git.txt
Last active April 16, 2024 06:20
Hydra with Git setup links
Lots of goodies like <githubstatus> pinging.
https://github.com/input-output-hk/iohk-ops/blob/bc8195de286d8b9b55b06f2046ab5412307a51b6/modules/hydra-master-common.nix
Declarative jobset bootstrapping:
https://github.com/shlevy/declarative-hydra-example
Declarative jobset with Git PR evals:
https://github.com/cleverca22/hydra-configs/tree/master/toxvpn
Other notes:
@robinp
robinp / index-kythe.sh
Last active December 5, 2020 07:14
Indexing Kythe Go parts
bazel build kythe/go/languageserver/... --experimental_action_listener kythe/go/extractors/cmd/bazel:extract_kzip_go
./bazel-bin/kythe/go/indexer/cmd/go_indexer/go_indexer $(find bazel-out/k8-fastbuild/extra_actions -name '*.go.kzip') > go.ents
./bazel-bin/kythe/go/serving/tools/write_tables/write_tables --experimental_beam_pipeline --entries go.ents --out /data/kythe/beamed
# To serve it:
# Note: public_resources set to /tmp since not needed when only API is used.
./bazel-bin/kythe/go/serving/tools/http_server/http_server --serving_table /data/kythe/beamed --listen 0.0.0.0:8080 --public_resources /tmp
@robinp
robinp / Streaming.hs
Created March 31, 2019 09:19
LevelDB Stream merging and grouping
{- Note: originally for treetide.com -}
{- Releasing under Apache 2.0 licence (https://www.apache.org/licenses/LICENSE-2.0), feel free to reuse accordingly. -}
{-# LANGUAGE TupleSections #-}
module Database.LevelDB.Streaming.Extended
( module X
, mergeStreams
, groupStream
)
where
@robinp
robinp / github-vertical-unspace.user.css
Last active April 17, 2020 07:19
Stylus script for to make github code review vertically more compact.
/* Remove below comment in Stylus */
// Install Stylus, a minimal permissions CSS-modifier: https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne//
// Set to use regex match https://github.com/.*/pull/.*/files
// also https://github.com/.*/commit/.*#diff-.*
body {
font-size: 12px;
}
.blob-num {
@robinp
robinp / run.bat
Created February 10, 2019 22:11
Converting image dirs to pdf using imagemagick on Windows
for /D %%f in (*) do (
cd %%f
mkdir annotated
magick mogrify -path annotated -set filename:xxx %%t -fill black -undercolor white -gravity southwest -pointsize 24 -annotate +0+0 "%%[filename:xxx]" *png *jpg
magick convert annotated/* ../%%~nf.pdf
rm -r annotated
cd ..
)