Skip to content

Instantly share code, notes, and snippets.

@SplittyDev
SplittyDev / CurrencyConverter.swift
Last active November 13, 2024 09:09
Currency Conversion Swift
// Copyright 2024 FiveSheep OÜ
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@SplittyDev
SplittyDev / triangular_spheres.js
Last active October 12, 2020 17:59
P5.js Abstract Shapes
// Created by Marco Quinten (@SplittyDev).
// License: Public Domain. Do whatever you want with the code.
const W = 5000;
const H = 5500;
function isInCircle(x, y, cx, cy, r) {
return (Math.pow(cx - x, 2) + Math.pow(cy - y, 2)) < Math.pow(r, 2);
}
@SplittyDev
SplittyDev / ContactForm.md
Last active October 12, 2020 17:47
Several coding tests I came up with..

Aufgabe: Kontaktformular

Ziel der Aufgabe ist es, ein visuell ansprechendes und funktionales Kontaktformular unter Verwendung moderner Webtechnologien zu erstellen.

Anforderungen

Technische Anforderungen

  • Eigene Entwicklungsumgebung einrichten
  • Webserver mit PHP und MySQL
  • Backend in PHP 7, MySQL
  • Frontend in HTML5, CSS3, JS ES6+ falls notwendig
@SplittyDev
SplittyDev / iodine_rfc_match.md
Last active August 23, 2017 02:23
Iodine RFC: Match Expression

Iodine RFC: Match Expression

Proposed syntax (modified EBNF)

EBNF Syntax:

() = GROUP
[] = OPTIONAL
{}* = ZERO OR MORE
{}+ = ONE OR MORE
/*
* JSON-RPC 2.0 implementation as per http://www.jsonrpc.org/specification.
* License: MIT (https://opensource.org/licenses/MIT)
* Author: Marco Quinten <[email protected]>
*/
const debug = require('debug')('json-rpc');
// List of public API endpoints
var exposed = [];
@SplittyDev
SplittyDev / a_readme.md
Last active September 21, 2021 19:37
x86 bare metal protected mode itoa implementation

Freestanding x86 itoa implementation

For use in OS development.
Designed to be assembled with NASM, porting it over to other assemblers should be easy.

License

You are free to use, modify, distribute and sell this code.
A small message referring to this gist would be nice, though not required.

Important

This implementation uses a custom calling convention.

@SplittyDev
SplittyDev / eva.js
Created August 12, 2016 21:57
eva.js - The lightweight es6 event library.
// eva.js - The lightweight es6 event library.
var eva = (() => {
// Prepare local globals
var eva = {};
var receivers = [];
var gid = 0;
/**
* Verify the type of a parameter.
* Throw if the type does not match the expected type.
* @param {object} item - The argument itself
@SplittyDev
SplittyDev / test.html
Created July 11, 2016 03:10
Window Alert
<!-- The webpage should look something like that -->
<!DOCTYPE html>
<html>
<head>
<!-- Probably a few meta tags, scripts, etc here -->
<!-- Add the following to the end of the <head> section, just
before the </head> tag: -->
<script>
window.alert("Something!");
</script>

Keybase proof

I hereby claim:

  • I am splittydev on github.
  • I am splitty (https://keybase.io/splitty) on keybase.
  • I have a public key whose fingerprint is EA4E 6964 1BCD ECB7 F04C B3B5 7C7B 5F81 9AF8 3565

To claim this, I am signing this object:

var crypto = require('crypto')
var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
function nextRand (lower, upper) {
'use strict'
return Math.floor(Math.random() * (upper - lower + 1) + lower)
}
function generateId () {
'use strict'