Skip to content

Instantly share code, notes, and snippets.

Ivan Habunek ihabunek

Block or report user

Report or block ihabunek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View anon.sql
CREATE OR REPLACE FUNCTION anonymize_people()
RETURNS void AS
$$
DECLARE
first_names text[] := '{"April","Abigail","Adriana","Adrienne","Aimee","Alejandra","Alexa","Alexandra","Alexandria","Alexis","Alice","Alicia","Alisha","Alison","Allison","Alyssa","Amanda","Amber","Amy","Ana","Andrea","Angel","Angela","Angelica","Angie","Anita","Ann","Anna","Anne","Annette","Ariana","Ariel","Ashlee","Ashley","Audrey","Autumn","Bailey","Barbara","Becky","Belinda","Beth","Bethany","Betty","Beverly","Bianca","Bonnie","Brandi","Brandy","Breanna","Brenda","Briana","Brianna","Bridget","Brittany","Brittney","Brooke","Caitlin","Caitlyn","Candace","Candice","Carla","Carly","Carmen","Carol","Caroline","Carolyn","Carrie","Casey","Cassandra","Cassidy","Cassie","Catherine","Cathy","Charlene","Charlotte","Chelsea","Chelsey","Cheryl","Cheyenne","Chloe","Christie","Christina","Christine","Christy","Cindy","Claire","Claudia","Colleen","Connie","Courtney","Cristina","Crystal","Cynthia","Daisy","Dana","Danielle","Darlene","Dawn","Deanna
View line_selection.md

Line selection

The URL hash (fragment) describes the selected lines. Examples:

hash description
#L10 single line
#L10,15,20 multiple lines
#L10-15 span of lines
View gist:b14f14d2b948df9d99380f8a5d207506
From 53fec5930a999b22fcb633495ae61d24fa997614 Mon Sep 17 00:00:00 2001
From: Ivan Habunek <ivan@habunek.com>
Date: Tue, 15 Jan 2019 11:07:30 +0100
Subject: [PATCH git.sr.ht] This is the title, upto 50 chars
To: ~sircmpwn/sr.ht-dev@lists.sr.ht
The rest of the commit message goes here.
---
View aoc2018.day19.md

Advent of code 2019, day19

Annotated assembler code, program translated to python.

Registers

Aliases used in pseudocode & python shown in parenthesis.

r0 (r) - result accumulator
View aoc2018.day17
Advent of code 2018, day17
...........................................................................................................................................................................................................................................................................................................................................................................................
...........................................................................................................................................................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................
@ihabunek
ihabunek / refs.rss.xml
Last active Nov 16, 2018
rss for sr.ht
View refs.rss.xml
<rss version="2.0">
<channel>
<title>~ihabunek/foo refs - sr.ht</title>
<link>http://localhost:5001/~ihabunek/foo/refs</link>
<description>Git refs for ~ihabunek/foo</description>
<language>en-us</language>
<item>
<title>0.17.0</title>
<link>http://localhost:5001/%7Eihabunek/foo/refs/0.17.0</link>
<author>Ivan Habunek &lt;ivan@habunek.com&gt;</author>
View maim.sh
#!/usr/bin/env bash
# Find an unused file name to capture to
DIR=~/Pictures/Screenshots/
N=1
while [ -f "$DIR`printf %05d $N`.png" ]; do
N=$((N+1))
done
FILENAME=$DIR`printf %05d $N`.png
@ihabunek
ihabunek / README.md
Last active Oct 8, 2018
Human readable menus for Tjedan Restorana 2018
View README.md

Human readable menus for Tjedan Restorana 2018

As always, here are the menus in a single, readable and searchable markdown formatted file.

Script which generated this is at the bottom. Some manual adjustments were done to improve output quality.

Enjoy, Ivan

@ihabunek
ihabunek / tjedan-restorana-19.md
Last active Mar 9, 2018
Human readable menus for Tjedan restorana
View tjedan-restorana-19.md

19. Tjedan restorana

2018-03-09 - 2018-03-18
http://tjedanrestorana.com/

Web site scraped and parsed to generate a single markdown file containing all the menus.

Script used to generate the markdown is attached below the menus. Table of contents and minor adjustments done by hand.

Share and enjoy.

View recur.clj
(ns aoc2017.foo)
(def node-map
"A tree structure defined as a map"
{:a [:b :c]
:b [:d :e :f]
:e [:g :h :i]
:i [:j :k]})
(defn count-nodes
You can’t perform that action at this time.