Skip to content

Instantly share code, notes, and snippets.

View collinbarrett's full-sized avatar

Collin Barrett collinbarrett

View GitHub Profile
@collinbarrett
collinbarrett / vpn-refresh.sh
Last active December 24, 2021 07:25
DD-WRT script for selecting an optimal ProtonVPN server
#!/bin/sh
# https://collinmbarrett.com/protonvpn-dd-wrt-api-script/
# specify PATH to run from cron
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin
# kill openvpn
PID=$(pidof openvpn)
kill -s SIGTERM "$PID"
@collinbarrett
collinbarrett / profile.json
Last active March 5, 2020 13:51
A Windows Terminal config. Dependencies: Git for Windows, WSL (Ubuntu LTS), Fira Code
// Deprecated: Moved to https://github.com/collinbarrett/box-setup/blob/master/windows-terminal/profiles.json
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{4a745997-9220-4b9c-9fac-c18e93b46ab2}",
"profiles": [
{
"guid": "{4a745997-9220-4b9c-9fac-c18e93b46ab2}",
"hidden": false,
"name": "MinGW-w64",
<TypePattern DisplayName="StyleCop Classes, Interfaces, &amp; Structs" RemoveRegions="All">
<TypePattern.Match>
<Or>
<Kind Is="Class" />
<Kind Is="Struct" />
<Kind Is="Interface" />
</Or>
</TypePattern.Match>
<Entry DisplayName="Constants">
<Entry.Match>
@collinbarrett
collinbarrett / userChrome.css
Last active April 11, 2024 10:22
A userChrome.css to use with Tree Style Tab (https://github.com/piroor/treestyletab) for Firefox
/*
Windows
Location: C:\Users\<YourUsername>\AppData\Roaming\Mozilla\Firefox\Profiles\<YourFirefoxProfile>\chrome
Notes:
If minimize, maximize, and close buttons are no longer visible, enable the Title Bar or Menu Bar in Firefox Customize.
macOS
Location: /Users/<YourUsername>/Library/Application Support/Firefox/Profiles/<YourFirefoxProfile>/chrome
Notes:
If minimize, maximize, and close buttons overlap other controls, add the Flexible Space in Firefox Customize.
@chtzvt
chtzvt / dnsmasq.conf
Created September 20, 2017 20:30
Optimized Dnsmasq configuration, for use with OpenWRT/DD-WRT/Tomato/etc
# Charlton Trezevant's Zoomin DNSMasq Config - Version 1.0
# Having a large local cache speeds up subsequent DNS queries significantly (from several hundred msec to around 25-30)
# You may need to adjust this depending on the amount of free space you have
cache-size=10000
# This ensures local reverse lookup queries are never sent upstream (e.g. dig +noall +answer -x 10.0.1.1)
bogus-priv
# Names without a dot or other domain part will also not be forwarded upstream
domain-needed
# We won't need dnsmasq to overwrite the system's resolv.conf, as we have our own cache.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Async Unit Test</Title>
<Author>Rusty Divine</Author>
<Description>Async Unit Test Template with 3 Parts</Description>
<HelpUrl>https://msdn.microsoft.com/en-us/library/ms165394.aspx</HelpUrl>
<SnippetTypes />
<Keywords />
@parmentf
parmentf / GitCommitEmoji.md
Last active May 6, 2024 18:30
Git Commit message Emoji
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active April 25, 2024 17:19
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@sliekens
sliekens / TypeMemberLayout.xaml
Last active December 28, 2023 08:45
StyleCop Type Member Layout for Resharper 9
<?xml version="1.0" encoding="utf-16"?>
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<TypePattern DisplayName="COM interfaces" Priority="2000">
<TypePattern.Match>
<And>
<Kind Is="Interface" />
<Or>
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
<HasAttribute Name="System.Runtime.InteropServices.ComImport" />
</Or>