Skip to content

Instantly share code, notes, and snippets.

View mikaturk's full-sized avatar

Mika Turk mikaturk

View GitHub Profile
@mikaturk
mikaturk / 3b.js
Last active February 14, 2021 16:44
did:3:bafyreigqod7ocrkp3thnvw4wwchkl6mkdcbajqpvdb6xdzsrvuc23u5f4e
function toLetter(number = 0) {
return String.fromCharCode(number%26+65)
}
function toNumber(string = 'A', index = 0) {
return string.charCodeAt(index)-65
}
function encryptLetter(message='', key='', index=0) {
return toLetter(
<label for="euroinput">€</label>
<input name="euro" id="euroinput" type="number" min="0.05" step="0.05"></input>
<p id="coins"></p>
<script>
const euroCoins = [0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200, 500];
function toCoins(amount, coins) {
coins.sort((a,b)=>{
return a===b?0:a<b?1:-1;
});
export function riemann(f, xmin, xmax, step) {
let total = 0;
for (let i = xmin/step; i<xmax/step; i++) {
total += f(i*step)*step;
}
return total;
}

Keybase proof

I hereby claim:

  • I am mikaturk on github.
  • I am mikat (https://keybase.io/mikat) on keybase.
  • I have a public key ASBMZ7WMdE5J6tMZ-WQaVO5yH20RbCnwyCKYLBl5CDNzKAo

To claim this, I am signing this object:

alert('spooky!')
@mikaturk
mikaturk / dagrooster
Created October 29, 2014 14:49
dagrooster iframe app
<html>
<head>
<script>
//script for getting the week number
lln = "8605"
naam = "Mika Turk"
print = function () {}
Date.prototype.getWeek = function() {
var onejan = new Date(this.getFullYear(), 0, 1);
return Math.ceil((((this - onejan) / 86400000) + onejan.getDay() + 1) / 7);