Skip to content

Instantly share code, notes, and snippets.

View punker76's full-sized avatar
☮️
#PEACE

Jan Karger ツ ☀ punker76

☮️
#PEACE
View GitHub Profile
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Ghostly.Utilities
{
// Emoji list borrowed from https://github.com/lunet-io/markdig/blob/25959174d521c7f4458fa7b340d58a4ac136fa30/src/Markdig/Extensions/Emoji/EmojiParser.cs
public static class EmojiReplacer
{
private static Regex _regex;
private static Dictionary<string, string> _lookup;
public class PackIconControl : ContentControl
{
public PackIconControl()
{
SizeChanged += OnSizeChanged;
}
public static readonly DependencyProperty PackIconKindProperty =
DependencyProperty.Register(nameof(PackIconKind), typeof(object), typeof(PackIconControl),
new PropertyMetadata(default(object), PackIconKindPropertyChangedCallback));
@punker76
punker76 / Taskbar.cs
Created March 15, 2018 13:00 — forked from franzalex/Taskbar.cs
Class to get the taskbar's position, size and other properties.
/******************************************************************************
* Name: Taskbar.cs
* Description: Class to get the taskbar's position, size and other properties.
* Author: Franz Alex Gaisie-Essilfie
* based on code from https://winsharp93.wordpress.com/2009/06/29/find-out-size-and-position-of-the-taskbar/
*
* Change Log:
* Date | Description
* -------------|--------------------------------------------------------------
* 2017-05-16 | Initial design
@punker76
punker76 / GameHost.cs
Created November 29, 2017 09:49 — forked from Vanlalhriata/GameHost.cs
Host Unity game in WPF
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
namespace KinectRun.Host.Controls
{
// GameHost is a FrameworkElement and can be added to controls like so:
// var gameHost = new GameHost(container.ActualWidth, container.ActualHeight);
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls"
xmlns:Behaviours="clr-namespace:MahApps.Metro.Behaviours"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters">
<Converters:ThicknessBindingConverter x:Key="ThicknessBindingConverter" />
<Style x:Key="ExpanderBaseHeaderStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="Background" Value="Transparent" />
@punker76
punker76 / AeroColorProvider.cs
Created October 15, 2015 21:34 — forked from usagirei/AeroColorProvider.cs
MahApps Metro DWM Colored Accent
/*
* Provides DWM Color as a Bindable Property
* Add the Namespace
* xmlns:dwmAero="clr-namespace:MahApps.Metro.DWMAero"
* And a Resource
* <dwmAero:AeroColorProvider x:Key="AeroColorProvider" />
* Then Bind on the Properties (110%,95%,80%,65%,50% Respectively)
* Color="{Binding Source={StaticResource AeroColorProvider}, Path=Highlight}"
* Color="{Binding Source={StaticResource AeroColorProvider}, Path=Accent}"
* Color="{Binding Source={StaticResource AeroColorProvider}, Path=Accent2}"
@punker76
punker76 / 0_reuse_code.js
Created April 19, 2014 08:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Interop;
/// <summary>
/// Popup with code to not be the topmost control
@punker76
punker76 / coffeescript_converter.rb
Created August 28, 2012 07:07 — forked from phaer/coffeescript_converter.rb
A trivial CoffeeScript.org -> Javascript plugin for jekyll ( https://github.com/mojombo/jekyll ). Put this file in '_plugins/' and write a YAML header to your .coffee files (i.e. "---\n---\n")
module Jekyll
require 'coffee-script'
class CoffeeScriptConverter < Converter
safe true
priority :normal
def matches(ext)
ext =~ /coffee/i
end