Skip to content

Instantly share code, notes, and snippets.

View ryanwebjackson's full-sized avatar

Ryan Jackson ryanwebjackson

View GitHub Profile
@victorlin
victorlin / github-delete-stale-branches.js
Last active March 20, 2024 02:27
Delete stale branches from the GitHub repo's stale branches page (github.com/user/repo/branches/stale). Originally from https://stackoverflow.com/a/69089905
// Paste in browser console and run
async function deleteStaleBranches(delay=500) {
var stale_branches = document.getElementsByClassName('js-branch-delete-button');
for (var i = 0; i < stale_branches.length; i++)
{
stale_branches.item(i).click();
await new Promise(r => setTimeout(r, delay));
}
}
@jaredpar
jaredpar / evilnames.cs
Created November 5, 2019 00:27
Evil async and await C# code
using System;
using System.Runtime.CompilerServices;
public class C {
async async await(await async) => await async;
}
[AsyncMethodBuilder(typeof(builder))]
class async {
public awaiter GetAwaiter() => throw null;
@ryanwebjackson
ryanwebjackson / delicious.html
Created April 14, 2019 22:51 — forked from jgarber623/delicious.html
A sample of the Netscape Bookmark File Format as exported from Delicious.
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><A HREF="https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html#//apple_ref/doc/-%20uid/TP40014508" ADD_DATE="1414706885" PRIVATE="0" TAGS="javascript,mac,osx,yosemite">JavaScript for Automation Release Notes</A>
<DD>This article describes JavaScript for Automation, a new feature in OS X Yosemite.
Does anyone use JSON for custom configuration files and if so, are there any conventions or common practices, when reading them from a .NET project? I have created a simple schema for one data type, and want to be able to store a collection of those in this config file, and I'm wondering if the { "data": ... } pattern makes sense or if there's another convention I should be using that makes more sense.
https://github.com/Dynalon/JsonConfig
https://stackoverflow.com/questions/30042795/building-a-json-configuration-section
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Linq.Expressions;
namespace UnitTesting.MyAssembly
{
internal class MockTable<T> : ITable<T> where T : class
https://twitter.com/switchology/status/1037814109440565248
https://cmatskas.com/how-to-update-your-git-credentials-on-windows/
git config --global credential.helper wincred
Via PowerShell?
@ryanwebjackson
ryanwebjackson / Settings.runsettings
Created September 22, 2018 17:57
Modern test settings file aimed at preventing concurrent test runs, using MSTest framework.
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<MaxCpuCount>1</MaxCpuCount>
</RunConfiguration>
</RunSettings>
//https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.getgroupnames(v=vs.110).aspx
function uptime() {
(get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Format-Table
}