Skip to content

Instantly share code, notes, and snippets.

View Keboo's full-sized avatar

Kevin B Keboo

View GitHub Profile
@Ciantic
Ciantic / keyboardlistener.cs
Created July 11, 2010 17:33
C# Keyboard listener
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Windows.Input;
using System.Windows.Threading;
using System.Collections.Generic;
namespace Ownskit.Utils
{
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@yohhoy
yohhoy / ff2cv.cpp
Last active April 12, 2024 06:49
Read video frame with FFmpeg and convert to OpenCV image
/*
* Read video frame with FFmpeg and convert to OpenCV image
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>
@DustinCampbell
DustinCampbell / using-msbuildworkspace.md
Created April 10, 2018 21:36
Using MSBuildWorkspace

Introduction

Roslyn provides a rich set of APIs for analyzing C# and Visual Basic source code, but constructing a context in which to perform analysis can be challenging. For simple tasks, creating a Compilation populated with SyntaxTrees, MetadataReferences and a handful of options may suffice. However, if there are multiple projects involved in the analysis, it is more complicated because multiple Compilations need to be created with references between them.

To simplify the construction process. Roslyn provides the Workspace API, which can be used to model solutions, projects and documents. The Workspace API performs all of the heavy lifting needed to parse SyntaxTrees from source code, load MetadataReferences, and construct Compilations and add references between them.

@jespersh
jespersh / MaterialDesignTheme.TabControl.xaml
Created December 6, 2018 14:19
Tabcontrol and tabitem for MaterialDesignTheme
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="http://materialdesigninxaml.net/winfx/xaml/themes">
<Style x:Key="MaterialDesignTabControl" TargetType="{x:Type TabControl}">
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style x:Key="MaterialDesignTabItem" TargetType="{x:Type TabItem}">
<Setter Property="Background" Value="{DynamicResource MaterialDesignBackground}" />
@punker76
punker76 / MainWindow.xaml
Created February 6, 2019 20:36
Detecting Windows 10 Dark/Light mode
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
@jamesmontemagno
jamesmontemagno / live-streaming-kit.md
Last active September 5, 2022 16:28
Live Streaming Kit

Here is my live stream setup kit :)

If you are doing a personal stream, I recommend only streaming to a single service such as Twitch. It is better for community building and easier on the streamer. Additionally, if you become an affiliate you are locked into a platform anyways.

How my setup works is that I have my main Desktop PC that has my streaming software, chat, alerts, music, and such all running on it. I have a second surface book that has HDMI out into the capture card in my Desktop PC. I do this because often when you compile apps it may freeze up your computer and stream :(. I have 2 sets of keyboards and mice and 2 monitors that I work off of. This works for me, but you do you :)

Software:

  • OBS: Your main go to for streaming software. It works on every OS :). If you want something with everything baked in take a look at Streamlabs OBS.
  • Streamlabs has all of your pop ups for subscribers and such on t
using System;
static class Program
{
static void Main(string[] args)
{
bool b = GetTricksyBool();
if (b) Console.WriteLine(b.IsTrue());
}
static bool IsTrue(this bool b)