Skip to content

Instantly share code, notes, and snippets.

View natemcmaster's full-sized avatar

Nate McMaster natemcmaster

View GitHub Profile
@FradSer
FradSer / iterm2_switch_automatic.md
Last active March 28, 2024 00:04
Switch iTerm2 color preset automatic base on macOS dark mode.

The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.

Vist iTerm2 homepage or use brew install iterm2-beta to download the beta. Thanks @stefanwascoding.


  1. Add switch_automatic.py to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch with:
@blowdart
blowdart / UpdateIISExpressSSLForChome.ps1
Last active October 7, 2021 10:59
IIS Express certs (for now) don't contain SAN strings. This makes Chrome unhappy. Make Chrome happy again with a new organic, artisanal, gluten free HTTPS certificate.
# Create a new self signed HTTPS Certificate for IIS Express
# Crafted with all organic, GMO, gluten free ingreditations
# with an artisinal SAN to make Chrome 58 onwards happy.
#
# See https://bugs.chromium.org/p/chromium/issues/detail?id=308330
#
# Run this at an administrative PowerShell prompt.
#
# You will be prompted to trust a new certificate via a windows dialog.
# Click yes otherwise Visual Studio will not be able to determine your
@davidfowl
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@skratchdot
skratchdot / hash_dir.sh
Created December 9, 2015 11:21
Get the shasum hash of an entire directory (recursively)
#!/bin/sh
find ./src -type f -print0 | sort -z | xargs -0 shasum | shasum
@dgoguerra
dgoguerra / p4merge-git-tool.md
Last active March 24, 2024 14:02
Setup p4merge as difftool and mergetool on Windows

Setting up p4merge as diff and merge tool on Windows. Tried for Git version 1.8.4.msysgit.0.

Two alternatives are explained: using the command line, and directly editing the config file.

Setting up from the command line

Being the installation path "C:Program Files\Perforce\p4merge.exe", just run:

$ git config --global diff.tool p4merge
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@micahasmith
micahasmith / process-async-await.cs
Created March 4, 2013 19:51
.NET Process via Async/Await
public class Runner
{
public async Task<RunResults> Run(ProcessStartInfo info)
{
var process = new Process();
var runResults = new RunResults();
//some defaults that HAVE to be in place
info.RedirectStandardOutput = true;
info.RedirectStandardError = true;
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 11, 2024 07:57
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@michaelcox
michaelcox / xdr.js
Created May 10, 2012 18:56
Adds XDomainRequest IE CORS support to jQuery
// Based on https://github.com/jaubourg/ajaxHooks/blob/master/src/ajax/xdr.js
(function( jQuery ) {
if ( window.XDomainRequest && !jQuery.support.cors ) {
jQuery.ajaxTransport(function( s ) {
if ( s.crossDomain && s.async ) {
if ( s.timeout ) {
s.xdrTimeout = s.timeout;
delete s.timeout;
@henrik242
henrik242 / p4merge
Last active January 5, 2023 22:23
Helper script for p4merge and Git on MacOSX
#!/bin/bash
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/P4Merge.app/Contents/Resources/launchp4merge "${absargs[@]}"