Skip to content

Instantly share code, notes, and snippets.

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

Mladen Mihajlović mika76

🤖
Coding...
  • Serbia
  • 03:43 (UTC +02:00)
View GitHub Profile
@mika76
mika76 / Liquibase.Common.Tasks
Created November 1, 2022 19:38 — forked from mitchelldavis/Liquibase.Common.Tasks
Some MSBuild Scripts for Liquibase and MS Sql.
<?xml version="1.0" encoding="utf-8"?>
<Project InitialTargets="" DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<AssemblyFile>$(MSBuildThisFileDirectory)\..\packages\MSBuild.Extension.Pack\tools\net40\MSBuild.ExtensionPack.TaskFactory.PowerShell.dll</AssemblyFile>
</PropertyGroup>
<UsingTask TaskFactory="PowershellTaskFactory" TaskName="CreateDatabaseTask" AssemblyFile="$(AssemblyFile)">
<ParameterGroup>
<ScriptsDirectory Required="true" ParameterType="System.String" />
<Server Required="true" ParameterType="System.String" />
@mika76
mika76 / style.css
Created July 18, 2022 07:07
Fill empty css table cell td with pattern if empty
/* Some different patterns: https://www.magicpattern.design/tools/css-backgrounds */
td.fill-empty:empty {
opacity: 0.8;
background-size: 10px 10px;
background-image: repeating-linear-gradient(45deg, #f2f2f2 0, #f2f2f2 2px, rgba(255, 0, 0, 0) 0, rgba(255, 0, 0, 0) 50%);
}
@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 30, 2025 20:08
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()