Skip to content

Instantly share code, notes, and snippets.

View JakobFerdinand's full-sized avatar

Jakob Ferdinand Wegenschimmel JakobFerdinand

View GitHub Profile
@JakobFerdinand
JakobFerdinand / submodules.md
Created May 28, 2020 06:17 — forked from manasthakur/submodules.md
Using git submodules to version-control Vim plugins

Using git-submodules to version-control Vim plugins

If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need. Thus, you should keep the .vim directory along with your .vimrc version-controlled.

But when you have plugins installed inside .vim/bundle (if you use pathogen), or inside .vim/pack (if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.

Creating the repository

Initialize a git repository inside your .vim directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:

cd ~/.vim
@JakobFerdinand
JakobFerdinand / cloudflare_update.script
Created April 30, 2020 14:07 — forked from kiler129/cloudflare_update.script
Automatic script for Mikrotik RouterOS updating record on CloudFlare.
#########################################################################
# ================================================== #
# $ Mikrotik RouterOS update script for CloudFlare $ #
# ================================================== #
# #
# - You need a CloudFlare account & api key (look under settings), #
# a zone and A record in it #
# - All variables in first section are obvious, except CFid, #
# To obtain CFid use following command in any unix shell: #
# curl https://www.cloudflare.com/api_json.html -d 'a=rec_load_all' -d 'tkn=YOUR_API_KEY' -d 'email=email@example.com' -d 'z=domain.com'|python -mjson.tool
@JakobFerdinand
JakobFerdinand / ApplicationInsightsClient.cs
Created January 24, 2020 09:54
ApplicationInsight for .Net Client Applications
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.DependencyCollector;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector;
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse;
using Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@JakobFerdinand
JakobFerdinand / TaskbarHelper.cs
Last active November 29, 2018 07:14
An AttachedProperty that lets you display a different windows in the same process in different taskbar groups in windows.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
namespace TasbarSample
{
public static class TaskbarHelper
{
@JakobFerdinand
JakobFerdinand / DynamicProxyGeneration.csx
Last active October 3, 2018 05:17
A script to create a dynamic subtype of a given type and overrides all virtual properties. Can be extended to raise events, call logging methods, etc...
using System.Linq;
using System.Reflection.Emit;
using System.Reflection;
using static System.Console;
public T CreateProxy<T>() where T : class
{
var baseType = typeof(T);
var assemblyName = new AssemblyName("Poxies");
@JakobFerdinand
JakobFerdinand / ToArrayVsToImmutableList.cs
Last active October 1, 2018 10:49
A performance comparison between ToArray() vs ToImmutableList().
#r ".\System.Collections.Immutable"
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using static System.Console;
class Person
{
public int Id { get; set; }