Skip to content

Instantly share code, notes, and snippets.

View mio991's full-sized avatar

Jonas Arndt mio991

  • Leipzig, Germany
View GitHub Profile
@mio991
mio991 / templating.ts
Created September 9, 2020 18:23
Some Typescript for template descriptions
type Filter<K extends keyof C, C, U> = C[K] extends U & Assignables ? K : never;
type BaseAssignables = string | boolean | number | symbol | undefined | null;
type Assignables = BaseAssignables | BaseAssignables[]
type Context = {
[K in PropertyKey]?: Assignables | ((ev: HTMLElementEventMap[keyof HTMLElementEventMap]) => any);
}
@mio991
mio991 / Jacobi.m
Last active November 23, 2017 10:26
Octave Jacobi
# Jacobi Methode
#
# Fuer das Numerik I Seminar.
function res = Jacobi(A, b, depth = 10)
res =# Jacobi Methode
#
# Fuer das Numerik I Seminar.
function res = Jacobi(A, b, depth = 10)
@mio991
mio991 / newtown.hs
Created January 20, 2017 09:04
Haskell implementation des Newtown Algorithmus
-- Deklaration des Newtown Algorithmus wobei die Argumente bedeuten:
-- Startwert, Funktion, abgeleitete Funktion, Iterator (zählt nach 0 runter)
newtown :: Double -> (Double -> Double) -> (Double -> Double) -> Int -> Double
-- Abbruchbedingung
newtown x f g 0 = (x - ((f x)/(g x)))
-- Standardfall
newtown x f g itt_depth = newtown (x - ((f x) / (g x))) f g (itt_depth-1)
-- Deklaration von f und g in ghci
{-
@mio991
mio991 / rw.go
Last active July 10, 2016 14:27
package main
import(
"encoding/json"
"path/filepath"
"log"
"os"
"time"
"net/http"
"fmt"
@mio991
mio991 / Auftrag.php
Last active August 29, 2015 14:01
A BussinesObject base class for mongodb with php and a sample inherit class.
<?php
require_once 'data/BussinesObject.php';
class Auftrag extends BussinesObject
{
public function Auftrag($var, $db)
{
parent::BussinesObject($var, $db, constant("AUFTRAG_COLLECTION"));
}
@mio991
mio991 / Go.sublime-build
Created April 26, 2014 10:55
A Sublime-Build file for golang
{
"cmd": ["go", "build", "$file"],
"variants":
[
{
"name": "Run",
"cmd": ["go", "run", "$file"]
}
]
}