This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pyclean command to clear all python cache in a directory | |
# source: https://stackoverflow.com/questions/28991015/python3-project-remove-pycache-folders-and-pyc-files | |
# in .bash_profile / .bash_rc etc put: | |
pyclean () { | |
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copy all ignored files from a git repo to $FOLDER | |
FOLDER= "/path/to/folder" | |
for file in $(git ls-files --others -i --exclude-standard); do | |
cp --parents "$file" "$FOLDER" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
# requires a recent enough python with idna support in socket | |
# pyopenssl, cryptography and idna | |
from OpenSSL import SSL | |
from cryptography import x509 | |
from cryptography.x509.oid import NameOID | |
import idna | |
from socket import socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#coding: utf-8 | |
inntekter = { | |
'kontigent': 50.00 * 10 | |
} | |
utgifter = { | |
'domeneavgift': 110, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Webcam test</title> | |
<script type="text/javascript"> | |
function loadstream(stream) { | |
console.log(stream); | |
video = document.getElementById("webcam"); | |
video.src = window.URL.createObjectURL(stream); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Adds a user to a mac. | |
# | |
# based on this article: http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-works-with-leopard/ | |
# | |
# Usage: ./mac_adduser.sh <username> <uid> <gid> | |
# | |
username=$1 |
NewerOlder