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 python3 | |
# -*- coding: utf-8 -*- | |
# | |
# bokstav_hyppighet.py | |
# | |
# Trekk ut en sortert liste av alfabetets bokstaver etter hyppighet i teksten | |
import sys | |
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/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 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 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 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 -*- | |
# 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 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
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 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/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, [email protected] | |
# | |
from datetime import datetime, date | |
from PIL import Image, ImageDraw, ImageFont, ImageOps |
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/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 |
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 | |
#! /bin/bash -vx | |
# input: | |
# new_background.sh -reset - to reset background to the previous picture | |
# new_background.sh -set - to set a new background | |
# | |
# Found at https://askubuntu.com/questions/1194187/alternatives-to-hydrapaper-for-dual-monitor-wallpapers | |
lastImage=$HOME/.new_background_last_image.txt |
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/python3 | |
# Coding: utf-8 | |
import sys | |
# Function to check if number is prime | |
def isPrime(n): | |
return all(n % i for i in range(2, n)) | |
# Function to check for Self number |
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/python3 | |
# coding: utf-8 | |
def main(): | |
'''Convert each character in a name to a number (a=1, b=2..) | |
and check if it is a prime number summed.''' | |
chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', \ | |
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'æ', 'ø', 'å'] |