Skip to content

Instantly share code, notes, and snippets.


Kristján Oddsson koddsson

View GitHub Profile

Keybase proof

I hereby claim:

  • I am koddsson on github.
  • I am koddsson ( on keybase.
  • I have a public key whose fingerprint is 891D 6C9B CAAD 8306 729D 9A5E C43C C5CA C64E 44AE

To claim this, I am signing this object:

koddsson / 28.clj
Created Jul 6, 2014
Running into problems with Clojure return types
View 28.clj
(ns com.koddsson.for-clojure
(:use [clojure.test :only [is deftest run-tests]]))
(defn my-flatten
([x] (if (not (and (seq? x) (vector? x)))
x ; If x is not a sequence nor a vector
(map my-flatten x)))) ; else recursivly apply the flatten function
(deftest test28
(is (= (my-flatten '((1 2) 3 [4 [5 6]])) '(1 2 3 4 5 6)))
View gif
# Delay before starting
# Sound notification to let one know when recording is about to start (and ends)
beep() {
paplay /usr/share/sounds/KDE-Im-Irc-Event.ogg &
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y git
git clone server-setup
cd server-setup
cd ..
rm -rf server-setup

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,

View chrome.manifest
content github-emojis ./ contentaccessible=true
View gulpfile.js
var gulp = require('gulp');
gulp.task('default', function () {
var postcss = require('gulp-postcss');
return gulp.src('index.css')
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 / filter-widget-selectboxes.js
Last active Dec 17, 2015
Filter widget select boxes based on a criteria.
View filter-widget-selectboxes.js
// Edit this object with the id of the select element and a array of values to
// keep.
var optionsToKeep = {
'activity-pcat256': [0, 1],
'activity-pcat258': [0, 2, 3],
'activity-pcat257': [0, 4, 5]
var filterSelectBoxes = function(options) {
var toDelete = [];
View bundle.js
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;