Skip to content

Instantly share code, notes, and snippets.


Kristján Oddsson koddsson

View GitHub Profile
koddsson /
Last active Oct 22, 2021
Runs a `post-push` hook after a successful run of `git push`
git() {
ROOT="$(/usr/bin/git rev-parse --show-toplevel)"
if [ "$1" == "push" ] && [ -f "$ROOT$LOCATION" ]; then
/usr/bin/git $* && eval $ROOT$LOCATION
/usr/bin/git $*
koddsson / bib.bib
Created Dec 24, 2020
Create a HTML post from a obsidian markdown page
View bib.bib
title = {How to Take Smart Notes: One Simple Technique to Boost Writing, Learning and Thinking: For Students, Academics and Nonfiction Book Writers},
shorttitle = {How to Take Smart Notes},
author = {Ahrens, S{\"o}nke},
year = {2017},
address = {{North Charleston, SC}},
isbn = {978-1-5428-6650-7},
language = {eng}
koddsson / index.js
Created Dec 19, 2019
A simple app that scrapes rightmove for flats and sends them to a Telegram chat.
View index.js
#!/usr/bin/env node
const cheerio = require('cheerio')
const fetch = require('node-fetch')
const loki = require('lokijs')
const telegram = require('telegram-bot-api')
const api = new telegram({ token: process.env.TELEGRAM_API });
const db = new loki('rightmoveFile', {
autoload: true,
koddsson / n
Created Jun 26, 2019
Simple Bash script that let's me post a micropub note from my terminal
View n
#! /bin/bash
CODE=$(cat token)
STATUS_CODE=$(curl -sw '%{http_code}' -o /dev/null -d "code=$CODE&redirect_uri=$ME"
if [ $STATUS_CODE -eq 404 ]; then
View gist:ac642e3986f430852618f8ee2517e0e5

Keybase proof

I hereby claim:

  • I am koddsson on github.
  • I am koddsson ( on keybase.
  • I have a public key ASDwi_uJqSvD3Q_-HXzwzFS1lFeiI0w5tUbP4ayRTJK8Qwo

To claim this, I am signing this object:


await in getter.

Since you can't make getters async in JavaScript classes it's impossible to do something like this:

class Foobar {
  set src(url) {
    this.src = url
    await this.fetchResults() // Unexpected keyword since the function isn't marked as `async`

Lint checker comments on GitHub PR using Travis

I really like PEP8. It's a standard that's used pretty much everywhere in the python "world". It's job is to make sure that your code adheres to certain rules, for example no line of code should exceed 80 characters.

Recently I opened up a pull request to add a flake8 check to the snippets-service project at mozilla. Flake8 is a command line tool that "lints" your code against certain standards,