Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
Coding...

Mladen Mihajlović mika76

🤖
Coding...
  • Serbia
View GitHub Profile
@mika76
mika76 / IniSerializer.cs
Last active Sep 13, 2020
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.
View IniSerializer.cs
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 Aug 18, 2020 — forked from sploders101/MuuriGrid.vue
Array-based muuri grid
View MuuriGrid.vue
<template>
<div
ref="muuriel"
class="muuri"
>
<div
class="muuri-item"
v-for="field in value"
:muurikey="field[muurikey]"
@mika76
mika76 / pliim-turnOff.scpt
Created Jun 12, 2020 — forked from zehfernandes/pliim-turnOff.scpt
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
View pliim-turnOff.scpt
# 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
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<link rel=icon href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text
y='.9em' font-size='90'>😍</text></svg>">
</head>
<body>
</body>
</html>
@mika76
mika76 / int2ip.js
Created Mar 22, 2020 — forked from jppommet/int2ip.js
javascript conversion from ip address to long integer and vice versa
View int2ip.js
function int2ip (ipInt) {
return ( (ipInt>>>24) +'.' + (ipInt>>16 & 255) +'.' + (ipInt>>8 & 255) +'.' + (ipInt & 255) );
}
@mika76
mika76 / copyfiles.ps1
Last active Jan 24, 2020
TFS powershell copy items to unc with credentials
View copyfiles.ps1
# Create credential from user pass strings
$User = "192.168.0.10\administrator"
$PWord = ConvertTo-SecureString -String "pass123" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
# Create mapped drive Y: with the UNC path
New-PSDrive -Name Y -PSProvider filesystem -Root "\\192.168.0.10\sharedfolder" -Credential $Credential
# Copy files to Y: drive
View QueryVisitor.cs
using Lucene.Net.Index;
using Lucene.Net.Search;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Lucene.Helpers
{
// https://stackoverflow.com/a/5748786/11421
View 10-large.sql
select top 10 schema_name(tab.schema_id) + '.' + tab.name as [table],
cast(sum(spc.used_pages * 8)/1024.00 as numeric(36, 2)) as used_mb,
cast(sum(spc.total_pages * 8)/1024.00 as numeric(36, 2)) as allocated_mb
from sys.tables tab
join sys.indexes ind
on tab.object_id = ind.object_id
join sys.partitions part
on ind.object_id = part.object_id and ind.index_id = part.index_id
join sys.allocation_units spc
on part.partition_id = spc.container_id
@mika76
mika76 / 1-setup.md
Created Nov 8, 2019 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra
View 1-setup.md

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

View MefCollections.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.Specialized;
namespace AUtility
{
// From http://stackoverflow.com/questions/1770297/how-does-mef-determine-the-order-of-its-imports
You can’t perform that action at this time.