Skip to content

Instantly share code, notes, and snippets.

View joar's full-sized avatar
:bowtie:
Not wearing a bowtie

Joar Wandborg joar

:bowtie:
Not wearing a bowtie
View GitHub Profile
@joar
joar / .block
Last active August 16, 2016 13:04 — forked from mbostock/.block
Collision Detection
license: gpl-3.0
height: 960
@joar
joar / microbit-micropython-getting-started.md
Created July 23, 2016 05:51
MicroBit MicroPython - Getting started

Getting Started

  1. pip install uflash pyserial
  2. Connect your MicroBit, make sure you have a microUSB data-capable cable.
  3. uflash - Flashes the MicroPython firmware to the MicroBit.

REPL

  1. Run miniterm.py
  2. Select the port that your microbit is connected to.
@joar
joar / abbrs.fish
Created June 14, 2016 12:12
My fish shell abbreviations
# Fish shell abbreviations
abbr tso 'tmux -2 source'
abbr denv 'env | grep DOCKER_'
abbr xsel 'xsel -ib'
abbr ga 'git add'
abbr gaa 'git add -A .'
abbr gco 'git checkout'
abbr gl 'git pull'
abbr gp 'git push'
abbr gd 'git diff'
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@joar
joar / Makefile
Last active April 28, 2016 11:24
# Automatically update a gist from a local file
#
# Usage: make FILENAME.gist
%.gist: %
gist $(shell test -e $@ && echo -n '-u ' && cat $@) -p $< | tee $@
# /etc/sysctl.d/60-joar-custom.conf
# - Increase max process ID number, this is the maximum possible number on 64-bit linux(?)
kernel.pid_max = 4194303
# - A value between 0..100 where 0 means avoid swapping as much as possible
# and 100 means swap as much as possible.
# - To set temoporarily: sudo sysctl vm.swappiness=10
# https://help.ubuntu.com/community/SwapFaq#What_is_swappiness_and_how_do_I_change_it.3F
vm.swappiness = 10
import inspect
import logging
_log = logging.getLogger(__name__)
def parse_default_arguments(func, args, kwargs, arg_name, default=None,
default_func=None):
"""
Parse a function call and replace omitted arguments with a dynamic
KIOSK_SETTINGS=bolist.settings.kiosk.local_joar
SHOP_SETTINGS=bolist.settings.shop.local_joar
RENTAL_SETTINGS=bolist.settings.rental.local_joar
DOCKER_RUN=docker run --rm -it --restart=no
.PHONY: run-rabbitmq
run-rabbitmq:
$(DOCKER_RUN) \
-p 5672:5672 \
rabbitmq:3-management
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.