Skip to content

Instantly share code, notes, and snippets.

View mika76's full-sized avatar
🤖
Coding...

Mladen Mihajlović mika76

🤖
Coding...
  • Serbia
  • 23:38 (UTC +02:00)
View GitHub Profile
@mika76
mika76 / CSVTextInputFormatter.cs
Created July 12, 2022 07:31
CSVTextInputFormatter ASP.MVC
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Net.Http.Headers;
namespace x;
public class CSVTextInputFormatter : TextInputFormatter
{
@mika76
mika76 / xsd.ps1
Created July 11, 2022 08:57
XSD Geneator in Powershell
# Adapted from https://mylifeismymessage.net/generate-xsd-schema-from-xml-using-powershell/
param (
[Parameter(Mandatory)] [string] $xmlFilename,
[string] $xsdSchemaFilename = $null
)
if ([string]::IsNullOrEmpty($xsdSchemaFilename)) {
$xsdSchemaFilename = $xmlFilename.Replace(".xml",".xsd")
}
@mika76
mika76 / javascript-proxy-as-rest-client.js
Created February 23, 2022 21:35 — forked from DavidWells/javascript-proxy-as-rest-client.js
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
// Read FOMS (Russian Health Card) http://www.openscdp.org/scsh3/index.html
// with emulator
// Romam Kharin <romiq.kh@gmail.com>, 2014
// based on explore.js
function SimFOMS () {
this.fsel = 0; // 0 - none, num - num
this.data0201 = new ByteString("", HEX);
@mika76
mika76 / tools.md
Last active November 8, 2022 05:38
Tools I use
@mika76
mika76 / compose.js
Created March 6, 2021 20:40 — forked from goldhand/compose.js
ATA JS (Day 2) Functions - Daily Assignment Solutions reviewed in class
const reduce = require("./reduce");
/**
* Performs right-to-left function composition. The rightmost function may have
* any arity; the remaining functions must be unary.
* compose(f, g)(x) >> f(g(x))
*
* @example
* const doubleNegative = compose(x => x * -1, x => x * 2);
* doubleNegative(5); // -10
@mika76
mika76 / Info.cshtml
Last active October 20, 2021 16:49
phpinfo like page for .net core
@page
@{
Layout = "";
}
@using System.Linq;
@using System.Collections;
@using System.Reflection;
<html>
$callingAssembly = resolve-path $args[0]
echo "Running for $callingAssembly"
$ass = [Reflection.Assembly]::Loadfile($callingAssembly)
# [Reflection.AppDomain]::CurrentDomain
$refAssemblies = $ass.GetReferencedAssemblies()
@mika76
mika76 / IniSerializer.cs
Last active January 16, 2024 20:45
INI Serializer for .NET Core in C# - Pretty basic with some validations and Serialize and Deserialize methods. There are lot's of variations for ini files though so it will probably not support every scenario. Feel free to adapt to your use-case.
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace tools
{
/// <summary>
/// Serializer class for ini files.
@mika76
mika76 / MuuriGrid.vue
Created August 18, 2020 08:45 — forked from sploders101/MuuriGrid.vue
Array-based muuri grid
<template>
<div
ref="muuriel"
class="muuri"
>
<div
class="muuri-item"
v-for="field in value"
:muurikey="field[muurikey]"