Skip to content

Instantly share code, notes, and snippets.

@busla
busla / note.md
Last active January 15, 2021 21:29
Java: skelin, $PATH og $CLASSPATH

Ákvað að taka aðeins saman þessa uppsetningu ef einhver getur nýtt sér.

Athugið að þetta nær aðeins yfir MacOS og Linux því miður en sama aðferð er notuð á Windows en ég hef ekki hugmynd um hvar hlutirnir þar eru staðsettir.

Orðið forrit í eftirfarandi samhengi á við kóða sem hefur verið þýddur(compile-aður) í keyranlega skrá. Orðið skel verður notað sem samheiti yfir allar helstu tegundir skelja sem eru í notkun (sh, bash, zsh, o.s.f.v.)

Keyranleg forrit í skelinni geta verið staðsett í hinum og þessum möppum. Þegar heiti á keyranlegri skrá er sleginn inn í skelinni þá þarf skráin að vera til staðar í möppunni sem heitið er slegið inn. Skelin reynir ekki að leita að skrá með þessu heiti á allri vélinni.

En það væri frekar glatað að þurfa að vita nákvæmlega hvar öll forrit væru staðsett og þurfa svo að auki að cd-a sig inn í möppuna þar sem forritið væri til að keyra það.

@busla
busla / make-dropbox-url.service
Created August 30, 2020 12:40
Dropbox shared url from gnome screenshots
[Unit]
Description = Monitors ~/Pictures dir, copies new files to ~/Dropbox/Screenshots and creats a shared url
[Service]
User=<your-$USER>
ExecStart=/usr/local/bin/make_dropbox_url.sh
[Install]
WantedBy=multi-user.target
@busla
busla / keybase.md
Created July 21, 2019 23:25
keybase

Keybase proof

I hereby claim:

  • I am busla on github.
  • I am jonlevy (https://keybase.io/jonlevy) on keybase.
  • I have a public key ASCuI07UeF_TBUQuXua6QztYeFCOm3E9cD1f4KK-lnHWlgo

To claim this, I am signing this object:

@busla
busla / pathlib_vs_os_speed.py
Last active January 17, 2019 13:51
Simple (and probably naive) comparison between os and pathlib.Path when recursively crawling directories
import timeit
from pathlib import Path
from pathlib import Path
from datetime import datetime
import os
CHUNKS_DIR='/media/data/chunks'
PREFIX='segment-'
EXT='mp4'
@busla
busla / kjordaemi.json
Last active March 21, 2018 11:47
Svæði kjördæma á Íslandi í geojson (gögn frá lmi.is, 2017-12-24)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"features": [{"geometry": {"coordinates": [[[-21.98384658650274, 63.99016915841572], [-21.693056582112554, 63.99016915841572], [-21.693056582112554, 64.15258479868251], [[-21.98384658650274, 63.99016915841572], 64.15258479868251], [-21.98384658650274, 63.99016915841572]]], "type": "Polygon"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [[[-21.98384658650274, 63.99016915841572], [-21.83845158430765, 63.99016915841572], [-21.83845158430765, 64.07137697854911], [[-21.98384658650274, 63.99016915841572], 64.07137697854911], [-21.98384658650274, 63.99016915841572]]], "type": "Polygon"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [[[-21.98384658650274, 63.99016915841572], [-21.911149085405192, 63.99016915841572], [-21.911149085405192, 64.03077306848242], [[-21.98384658650274, 63.99016915841572], 64.03077306848242], [-21.98384658650274, 63.99016915841572]]], "type": "Polygon"}, "properties": {}, "type": "Feature"}, {"geometry": {"coordinates": [[[-21.98384658650274, 64.
@busla
busla / instructions.md
Last active September 16, 2017 11:05 — forked from tpai/instructions.md
use both Tor and Privoxy with Mac OSX

1. install

brew install tor
brew install privoxy

2. copy and modify config file

@busla
busla / models.py
Created July 25, 2017 22:23
Django unique slug
from django.db import models
from django.urls import reverse
from unidecode import unidecode #pip install unidecode
from django.utils.crypto import get_random_string
from django.utils.text import slugify
from taggit.managers import TaggableManager
class Blog(models.Model):
title = models.CharField(max_length=256)
@busla
busla / markdownx trace
Created May 1, 2017 22:04
markdownx traceback
Exception while resolving variable 'markdownx_editor' in template 'markdownx/widget2.html'.
Traceback (most recent call last):
File "/Users/levy/Code/innri/venv/lib/python3.5/site-packages/django/template/base.py", line 882, in _resolve_lookup
current = current[bit]
File "/Users/levy/Code/innri/venv/lib/python3.5/site-packages/django/template/context.py", line 87, in __getitem__
raise KeyError(key)
KeyError: 'markdownx_editor'
During handling of the above exception, another exception occurred:
@busla
busla / README.md
Last active November 21, 2016 07:52
Development environment for Yild providers

Yield provider development environment

One-liner for installing a fresh Drupal instance with Yild and contributed providers using a make file.

drush make drupal.make.yml your-drupal-folder-name && \
cd your-drupal-folder-name && \
drush si --db-url=mysql://user:pass@127.0.0.1:port/your-db-name --site-name="Yild provider development" --yes && \
drush en yild, yild_your_provider_name