Skip to content

Instantly share code, notes, and snippets.

View kebman's full-sized avatar
Playing Ponkatris

kebman kebman

Playing Ponkatris
View GitHub Profile
@kebman
kebman / profile.ps1
Created August 9, 2024 01:42
My profile for Windows PowerShell, including an UX-like `touch` function
function home { set-location "~" }
Set-Alias vim nvim
# Create a command similar to Linux `touch`
function touch {
Param(
[Parameter(Mandatory=$true)]
[string]$Path
)
@kebman
kebman / nordics_lightning_alert.py
Last active July 7, 2023 07:07
A small script that alerts the user of lightning if it strikes within 16 km (10 miles) of your home in the Nordics, based on observations from The Norwegian Meteorological Institute.
#!/usr/bin/python3
from sseclient import SSEClient
import json
from math import sqrt
import winsound # NOTE: Windows only
from datetime import datetime, timezone, timedelta
'''
Version 2.1 (2023-07-07): A small script that alerts the user of lightning if it strikes within 16 km (10 miles) of your home position in the Nordics.
Based on lightning observations broadcast as SSE from The Norwegian Meteorological Institute, https://www.met.no/.
@kebman
kebman / lyn_met_no_SSE_client.py
Last active July 27, 2021 11:18
Get SSE lightning strikes from the Norwegian Meteorological Institute at https://lyn.met.no/events
#!/usr/bin/python3
from sseclient import SSEClient
import json
# get the stream
thundercloud = SSEClient('https://lyn.met.no/events')
# keep checking for new lighning strikes
for lightning in thundercloud:
@kebman
kebman / orderFormatter.html
Created May 7, 2021 19:57
Coinbase Pro Order Formatting Tool in HTML5
<!DOCTYPE html>
<html class="no-js" lang="eng">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="Order Formatting App">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" href="css/main.css"> -->
<style type="text/css">
@kebman
kebman / tarkovModules.cypher
Last active May 16, 2020 00:08
Escape from Tarkov: Dealer to Module relations in Cypher for the graph database Neo4j
CREATE (h:Module {
name: "Air Filtering Unit I",
requirements: [
'$10,000',
'Generator III',
'Vents III',
'Skier III'
],
functions: [
"Group of skills levelling boost: Physical, +40%"
@kebman
kebman / COVID-19_data_from_Norway.json
Last active April 23, 2020 05:17
COVID-19 data from Norway: Tested, Infected, Hospitalized, Dead.
"source":"https://www.vg.no/spesial/2020/corona/",
"events":[
{"2020-03-13":"Change of test criteria"},
{"2020-03-26":"NIPH (FHI) uses MSIS data"},
{"2020-04-20":"Partial reopening of kindergartens and hair dressers"}
],
"majorReCheckOfDataset":["2020-04-03"],
"lastUpdated":["2020-04-03", "2020-04-08", "2020-04-17", "2020-04-21"],
"coronaTestDataForNorway": [
{
@kebman
kebman / UnicodeMath.sublime-settings
Last active November 23, 2022 02:08
User settings for Unicode Math for em dash, en dash and special quotation marks used in English, Norwegian, French and Swedish.
{
"symbols": {
"emdash": "\u2014", // —
"endash": "\u2013", // –
"laquo": "\u00AB", // «
"raquo": "\u00BB", // »
"ldquo": "\u201C", // “
"rdquo":"\u201D", // ”
"lsquo": "\u2018", // ‘
"rsquo": "\u2019", // ’
@kebman
kebman / compounding1.py
Created August 2, 2019 03:05
Calculate compounding interest with this short Python script.
#!/usr/local/bin/python3.7
principal = 10000.0
interest_rate = 5.0
time_units = 10
def get_percentage(inputf, percentage):
return inputf * percentage / 100.0
def get_compounding(principalf, n):
@kebman
kebman / RastaniRibbon.pine
Created June 30, 2019 01:40
The Rastani Ribbon, based on Alessio Rastani's moving averages
// See: Here's Exactly WHEN I am Buying Bitcoin. Alessio Rastani. Published on 8 Jun 2019. https://youtu.be/TiUUJxdynaY
study(title = "Rastani Ribbon", shorttitle="Rastani Ribbon", overlay=true)
src0 = close, len1 = input(21, minval=1, title="MA Length")
src1 = close, len2 = input(55, minval=1, title="MA Length")
src2 = close, len3 = input(100, minval=1, title="EMA Length")
src3 = close, len4 = input(100, minval=1, title="MA Length")
src4 = close, len0 = input(200, minval=1, title="MA Length")
sma1 = sma(src1, len1)
@kebman
kebman / USDNOKslider.html
Last active September 16, 2018 22:02
USD/NOK Currency Slider in HTML5
<!DOCTYPE html>
<html>
<head>
<title>USD/NOK Slider</title>
<meta charset="utf-8">
<style type="text/css">
.slidecontainer {
width: 20em; /* Width of the outside container */
}
/* Slider */