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
console.log("hellurei") | |
alert("hellurei alert!") |
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
// Henkilötunnus 2023 regex - new finnish social security, regex to identify potential numbers | |
// Does not actually validate using the checksum | |
// Allows for case-insensitivity using the /i in the end. | |
// Includes test variables and tests, just copy the old-form regex or new one | |
const oldSsnRegex = /^(\d{6}[-+A]\d{3}\S{1})$/i; | |
/** Compatible with old-form */ | |
const newSsnRegex = /^(\d{6}[a-zA-Z]\d{3}\S{1})$/i; | |
/** Old-form social security numbers |
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
// Mock-server for Azure OpenAI | |
// Using this as a basis to create a reverse-proxy, with our own API-system | |
// for different teams / people / billing to use OpenAI in our company | |
// This server is specifically built for VSCode Genie-responses | |
// https://github.com/ai-genie/chatgpt-vscode | |
// and uses Node GPT-wrapper underneath | |
// https://github.com/transitive-bullshit/chatgpt-api | |
// Code totally not cleaned up. Has artificial delay of 100ms |
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
// Global notification hook for React-applications. Easy way to send Notification for user in your application when needed | |
// Using: React + Redux + Typescript + Material-UI Snackbar | |
// Versions: | |
// Redux: 4.0.1 | |
// "@mui/material": "^5.4.1", | |
// "react": "^17.0.2", | |
// "react-router-dom": "^5.2.0", | |
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
// I used this function to find nested geoJson float values and round the values up to smaller decimals | |
function loopArray(nestedArrays) { | |
return nestedArrays.map(arrayNow => { | |
if (isArray(arrayNow)) { | |
return loopArray(arrayNow) | |
} else if (isNumber(arrayNow)) { | |
return 'your operation here' | |
} | |
}) |
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 | |
import os | |
import datetime | |
import sys | |
import subprocess | |
""" | |
Command line tool to run simple commands from repository root |