Skip to content

Instantly share code, notes, and snippets.

View MiYanni's full-sized avatar

Michael Yanni MiYanni

  • Microsoft
  • Seattle, WA
View GitHub Profile
@shaunlebron
shaunlebron / _README.md
Last active October 13, 2024 09:24
Direct3D9 Wrapper DLL

In response to a StackOverflow question:

This is code to build a Direct3D wrapper DLL, intercepting all calls to Direct3D interface functions so that you can draw your own objects to display over the game. Just plop the DLL into the same folder as the game's executable, and it should load it as if it were the real d3d9.dll file. It still forwards all calls to the real one in system32, just allows stuff to happen in between. original stackoverflow answer

@varemenos
varemenos / 1.README.md
Last active April 4, 2025 03:30
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@davidfowl
davidfowl / dotnetlayout.md
Last active May 9, 2025 16:45
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 13, 2025 18:32
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@Dayjo
Dayjo / gist-editor-resize-userscript.js
Last active May 21, 2024 20:58
Make Gist editor automatically resize based on content using a TamperMonkey script
// ==UserScript==
// @name gist-editor-resize-userscript
// @namespace https://gist.github.com/
// @version 0.1
// @description Automatically resize the gist editor for easier editing.
// @match http*://gist.github.com/*
// @copyright 2013+ Joel Day - blog.dayjo.org
// ==/UserScript==
var textareas = document.querySelectorAll('textarea.file_contents');
@tcshao
tcshao / FizzBuzz.fsx
Last active April 27, 2019 10:52
FizzBuzz in F#
let fizzBuzz x =
match x with
| _ when (x % 15) = 0 -> "FizzBuzz"
| _ when (x % 3) = 0 -> "Fizz"
| _ when (x % 5) = 0 -> "Buzz"
| _ -> ""
let fizzBuzzTo max =
[1..max]
|> List.iter (fun number -> printfn "%d %s" number (fizzBuzz number))
@jstangroome
jstangroome / Sample.csproj
Created July 11, 2012 04:27
MSBuild snippet to disable the default DLL output of a C# class library project
<Project>
<!-- the usual stuff -->
<!-- BEGIN disable default compile and copy binary behaviour -->
<Target Name="CoreCompile" />
<PropertyGroup>
<SkipCopyBuildProduct>true</SkipCopyBuildProduct>
</PropertyGroup>
<!-- END disable default compile and copy binary behaviour -->
@sayedihashimi
sayedihashimi / msbuild-get-date.proj
Created March 23, 2012 03:02
MSBuild how to get a good formatted date
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
DefaultTargets="Demo" >
<Target Name="Demo">
<PropertyGroup>
<CurrentDate>$([System.DateTime]::Now.ToString(yyyyMMdd-mmss))</CurrentDate>
</PropertyGroup>
@rbwestmoreland
rbwestmoreland / NuGet Package Automation Post-Build Event
Created December 11, 2011 17:00
NuGet package automation using a Visual Studio post-build event
if $(ConfigurationName) == Release "$(SolutionDir)packages\NuGet.CommandLine.1.5.21005.9019\tools\NuGet.exe" pack "$(ProjectPath)" -Properties Configuration=Release -Verbose
@JasonCozens
JasonCozens / MsBuildFilter.xml
Created January 27, 2011 13:56
This MSBuild script shows how to filter Items into two separate item lists. This could be used for filtering files for different installers etc .
<?xml version="1.0" encoding="utf-8"?>
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
>
<ItemGroup>
<Binary Include="SrcDir/assembly01.txt" >
<Server>.</Server>
</Binary>