Skip to content

Instantly share code, notes, and snippets.

View marcj's full-sized avatar
🖌️
Data

Marc J. Schmidt marcj

🖌️
Data
View GitHub Profile
marc at mpro in /tmp/asdasd
$ git clone https://github.com/deepkit/deepkit-framework.git
Klone nach 'deepkit-framework'...
remote: Enumerating objects: 48921, done.
remote: Counting objects: 100% (11464/11464), done.
remote: Compressing objects: 100% (1611/1611), done.
remote: Total 48921 (delta 10264), reused 10529 (delta 9841), pack-reused 37457
Empfange Objekte: 100% (48921/48921), 68.22 MiB | 4.40 MiB/s, fertig.
Löse Unterschiede auf: 100% (39231/39231), fertig.
#include <functional>
#include <iostream>
#define IMGUI_DEFINE_MATH_OPERATORS
#include "imgui.h"
#include "imgui_internal.h"
#include "imgui_impl_sdl2.h"
#include "imgui_impl_opengl3.h"
@marcj
marcj / form.ts
Created March 20, 2024 21:55
Deepkit Angular 2
/*
* Deepkit Framework
* Copyright (C) 2021 Deepkit UG, Marc J. Schmidt
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the MIT License.
*
* You should have received a copy of the MIT License along with this program.
*/
@marcj
marcj / component.ts
Last active March 20, 2024 21:52
Deepkit Angular form
export class OrderFilter {
order: string = '';
customer: string = '';
article: string = '';
}
@Component({
template: `
@marcj
marcj / app.ts
Created September 24, 2023 16:55
Deepkit dot path to objects serializer
test('dot path to objects', () => {
//given values like { "myArray[0].prop1.prop2": "123" } we want to convert it to { myArray: [{ prop1: { prop2: "123" } }] }
interface MyObject {
myArray: { prop1: { prop2: string } }[];
}
function convertPathObjectToValues(object: { [name: string]: any }): any {
//object has keys like "myArray[0].prop1.prop2"
@marcj
marcj / lstm.py
Last active May 9, 2023 18:28
Mini calculator LSTM
"""
This script tests how good LSTMs are at solving mini calc tasks like 1+2, 3+4, 5*5.
The challenge is that the input is as string and can have arbitrary many whitespaces between the numbers and operator.
"1+2"
" 2 * 4"
" 3 + 3"
To have the problem simple enough, only 1 digit numbers are allowed. So 1+2, but not 11+2. And only 2 operators: + and *.
import { AbstractControl, FormArray, FormControl, FormControlOptions, FormControlState, FormGroup, ValidationErrors, ValidatorFn } from "@angular/forms";
import { ClassType, isFunction } from "@deepkit/core";
import {
deserialize,
getValidatorFunction,
hasDefaultValue,
isCustomTypeClass,
isOptional,
isType,
ReflectionClass,
@marcj
marcj / diff.patch
Last active July 8, 2022 21:21
NX watch bug
~
diff --git a/apps/frontend/src/app/app.tsx b/apps/frontend/src/app/app.tsx
index 0a2d3c2..7df6a6e 100644
--- a/apps/frontend/src/app/app.tsx
+++ b/apps/frontend/src/app/app.tsx
@@ -1,9 +1,11 @@
import React, { useEffect, useState } from 'react';
-import { Message } from '@foo23/api-interfaces';
+import { Message, User } from '@foo23/api-interfaces';
type Command =
'foo0'
| 'foo1'
| 'foo2'
| 'foo3'
| 'foo4'
| 'foo5'
| 'foo6'
| 'foo7'
| 'foo8'
@marcj
marcj / memoize.ts
Created January 22, 2022 01:00
memoize jit
import { BenchSuite } from '../bench';
const memoize = require('memoizee');
function memoizeWithJIT(fn: Function, options: { stackSize: number } = { stackSize: 10 }): Function {
const stacks: string[] = [];
const variables: string[] = [];
const argNames: string[] = [];
for (let a = 0; a < fn.length; a++) {