Skip to content

Instantly share code, notes, and snippets.

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

Mladen Mihajlović mika76

🤖
Coding...
  • Serbia
  • 09:17 (UTC +02:00)
View GitHub Profile
@mika76
mika76 / stars.ps1
Last active January 28, 2024 15:08 — forked from sebble/stars.sh
List all starred repositories of a GitHub user.
[CmdletBinding()]
param (
[Parameter()]
[string]
$user = "mika76"
)
$URL = "https://api.github.com/users/$user/starred"
$PAGE = 0
@mika76
mika76 / useEmptySlotCheck.js
Created May 6, 2023 11:44 — forked from marina-mosti/useEmptySlotCheck.js
Vue 3 check for slot with no content
import { computed, Comment, Fragment, Text } from 'vue'
/**
* Determines whether a slot is empty for Vue 3: https://github.com/vuejs/vue-next/issues/3056
* @param {Function} slot - The slot $slot.name
* @returns {Boolean}
*/
// Adapted from https://github.com/vuejs/vue-next/blob/ca17162e377e0a0bf3fae9d92d0fdcb32084a9fe/packages/runtime-core/src/helpers/renderSlot.ts#L77
@mika76
mika76 / useHasSlot.js
Created January 25, 2023 13:43 — forked from rhysburnie/useHasSlot.js
vue3 determine if slot is being used (has content)
import { useSlots } from 'vue';
export default function useHasSlot() {
const slots = useSlots();
return function hasSlot(name) {
return slots[name] && !isEmptySlot(slots[name]());
};
}
function isEmptySlot(items) {
@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 / 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) {
@mika76
mika76 / dataview-polyfill.js
Created September 26, 2015 21:27
DataView (and ArrayBuffer) polyfill that works in any engine (including old IE).
void function(global){
if ('DataView' in global && 'ArrayBuffer' in global) {
return;
}
var hide = (function(){
// check if we're in ES5
if (typeof Object.getOwnPropertyNames === 'function' && !('prototype' in Object.getOwnPropertyNames)) {
var hidden = { enumerable: false };
// 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 / 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 / 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]"
@mika76
mika76 / pliim-turnOff.scpt
Created June 12, 2020 10:15 — forked from zehfernandes/pliim-turnOff.scpt
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell