Skip to content

Instantly share code, notes, and snippets.

View trentrand's full-sized avatar
🛰️
⠞⠗⠑⠝⠞

Trent Rand trentrand

🛰️
⠞⠗⠑⠝⠞
View GitHub Profile
// These are extracted from a project using pollyJS in Cypress
// They might not work, I've just copy/pastied what I thought was relevant and removed lines of codes specific to the project
const pollyConnect = (
win,
{ mocks, mode, pollyName },
) => {
console.log(
`%cInit polly ${pollyName} for location ${win.location}`,
'background: gray; color: white; padding: 5px',
@triffid
triffid / openrc-init-pia
Last active February 15, 2024 06:48
shell script for accessing PIA wireguard
#!/sbin/openrc-run
command="/root/bin/pia-wg.sh"
CONFIGDIR="${CONFIGDIR:-/var/cache/pia-wg}"
CONFIG="${CONFIG:-/etc/pia-wg/pia-wg.conf}"
extra_started_commands="reload"
depend() {
@triwav
triwav / roku-proxy-setup.md
Created April 30, 2019 14:33
Roku Proxy Setup

This is largely based off of this article by Hulu and their roku-dev-cli tool.

Requirements:
The main requirement is a Mac with 2 available network interfaces WIFI <-> WIFI, LAN <-> WIFI, etc. This should work on other platforms as well but isn't covered here.

Setup
The first thing we need is Homebrew. If you've never used it before it's a great package manager for macOS that makes installing programs easier. Open Terminal and paste
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and hit enter

@Serlych
Serlych / epub.css
Last active November 25, 2020 13:03 — forked from maticrivo/epub.css
You Don't Know JS Ebooks
body {
text-align: justify;
}
code, pre {
font-family: "Hack", monospace;
}
h1, h2, h3, h4, h5, h6 {
text-align: left;
@marcuslindfeldt
marcuslindfeldt / mockVisit.js
Created July 30, 2018 12:43
Cypress PollyJS fetch mock
const uuidV4 = require('uuid/v4');
import { Polly } from '@pollyjs/core';
import FetchAdapter from '@pollyjs/adapter-fetch';
import LocalStoragePersister from '@pollyjs/persister-local-storage';
Polly.register(FetchAdapter);
Polly.register(LocalStoragePersister);
Cypress.Commands.add('mockVisit', (url, mocks = () => null, options) => {
return cy.visit(
@kribblo
kribblo / npm-unpublish-range.sh
Created March 19, 2018 10:09
npm unpublish a range of versions
# Example: npm unpublish the-package from 0.5.31 to 0.5.41
for i in $(seq 31 41); do npm unpublish "the-package@0.5.$i"; done
# list available versions of the-package:
npm show the-package versions
@111a5ab1
111a5ab1 / edgeos_cli_mss_wireguard
Last active December 2, 2021 23:28
EdgeOS CLI: TCP MSS clamping to resolve PMTUD black holes (RFC2923) when using Wireguard
set firewall options mss-clamp interface-type all
set firewall options mss-clamp mss 1380
set firewall options mss-clamp6 interface-type all
set firewall options mss-clamp6 mss 1360
@alexislucena
alexislucena / uncommitLastCommit.md
Created November 14, 2016 08:56
Git: How to uncommit my last commit in git

To keep the changes from the commit you want to undo

$ git reset --soft HEAD^

To destroy the changes from the commit you want to undo

$ git reset --hard HEAD^

You can also say

@ajfisher
ajfisher / 0x00000.bin
Last active October 10, 2021 00:51
ESP8266 Transparent bridge to J5
@brianclements
brianclements / Commit Formatting.md
Last active July 19, 2024 13:32
Angular Commit Format Reference Sheet

Commit Message Format

This specification is inspired by and supersedes the [AngularJS commit message format][commit-message-format].

We have very precise rules over how our Git commit messages must be formatted. This format leads to easier to read commit history.

Each commit message consists of a header, a body, and a footer.