This file contains 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 | |
LOGFILE='logfile' | |
TIMEFORMAT='%Y-%m-%d-%H%M' | |
URL='https://webkamera.atlas.vegvesen.no/kamera?id=' | |
# Declare the locations and their webcam id in an associated array (Thanks BASH 4) | |
declare -A PLACES | |
PLACES=( \ | |
[bleik]=1335902_1 \ |
This file contains 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
from turtle import * | |
from random import * | |
def RandomPosition(): | |
penup() | |
posx = randint(-500, 500) | |
posy = randint(-200, 300) | |
setpos(posx, posy) | |
pendown() | |
This file contains 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
# Geometri, hva kan gjøres med bare firkanter? La oss bygge en by | |
from turtle import * | |
from random import * | |
HUS_FARGER = ["#363432", "#196774", "#90A19D", "#F0941F", "#BD2A2E", "#3B3936", "#889C9B", "#486966"] | |
VINDU_FARGER = ["#F2F2F2", "#202022"] | |
# Tegne firkant funksjon | |
def firkant(x, y, h, w, col): |
This file contains 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 python3 | |
# -*- coding: utf-8 -*- | |
# | |
# bokstav_hyppighet.py | |
# | |
# Trekk ut en sortert liste av alfabetets bokstaver etter hyppighet i teksten | |
import sys | |
This file contains 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/python3 | |
# coding: utf-8 | |
# | |
# If you sum each letter in a name using a=1, b=2... | |
# will the name be a prime number? Or even better, a palindrome? | |
# | |
import sys | |
def main(): |
This file contains 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 python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Hvis kvadratroten av et gitt tall er det samme som antall bokstaver i tallordet, | |
# kaller vi tallet for et kvadratrotord. | |
# | |
# Kjør scriptet med en nedre og øvre grense å teste på norsk eller engelsk, for eksempel slik: | |
# | |
# $ ./python3 finn_kvadratrotord.py 10 1000 norsk | |
# $ ./python3 finn_kvadratrotord.py 1000 1000000 engelsk |
This file contains 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 -*- | |
# https://deepai.org/machine-learning-model/colorizer | |
# | |
import requests | |
import sys | |
import subprocess | |
my_key = 'YOUR_KEY_HERE' | |
api_url = 'https://api.deepai.org/api/colorizer' |
This file contains 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
import requests | |
from subprocess import Popen | |
import sys | |
''' | |
A year in colors, -25 to 24 degrees over a range of colors from blue to red. | |
Color palette from: | |
- https://www.color-hex.com/color-palette/33335 | |
- https://meyerweb.com/eric/tools/color-blend/#194BFF:0022C9:10:hex |
This file contains 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/python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Script to create multiple images based on lines from text file | |
# Used to create a advent calendar at Andøya Space Education | |
# Author: Ørjan Vøllestad, orjan@andoyaspace.no | |
# | |
from datetime import datetime, date | |
from PIL import Image, ImageDraw, ImageFont, ImageOps |
This file contains 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/python3 | |
# -*- coding: utf-8 -*- | |
# | |
from bs4 import BeautifulSoup | |
import requests | |
from datetime import datetime, date | |
from PIL import Image, ImageDraw, ImageFont, ImageOps | |
import textwrap | |
import sys |