Skip to content

Instantly share code, notes, and snippets.

View addshore's full-sized avatar
🏄

addshore

🏄
View GitHub Profile
@Jaykul
Jaykul / Agent Passthru.md
Last active April 18, 2024 11:18
SSH Agent passthru to WSL 2 (working, in Windows 11, in May 2023)

For awhile now, each time I got a new Windows laptop I would dig up strasis gist on how to set up agent forwarding for SSH in WSL2 -- but recently I tried to point someone else at it and they were very confused by it, so this is my attempt at simpler instructions.

Installation

With Chocolatey, you must use an elevated PowerShell session. If there's no choco command found, it will fall back to winget for the npiperelay install. To force using Winget even if you have choco installed, you need to download it, so you can pass parameters to it.

Easy mode: just run this in PowerShell:

@gbirke
gbirke / Presentation.md
Last active February 21, 2022 16:12
Presentation on Clean Architecture in WMDE Fundraising
tags aliases created_on
2022-02-17

Clean Architecture and the Fundraising Application


What is the Clean Architecture

Between March 5th and 25th, 2013, one of the darkest periods in the robot history of Wikipedia occurred. A bot called Addbot, operated by Adam Shoreland, an employee of the Berlin-based Wikimedia Deutschland, committed the most aggressive bot-on-bot revert conflict events ever recorded. In a flurry of inefficiency and inefficacy, Addbot reverted 146,614 contributions other bots had made to English Wikipedia, removing links between different language versions of Wikipedia articles, which had been automatically curated and updated by dozens of different bots. Over a 20-day rampage, the bot annihilated their work and the work of their maintainers. The fact that such a massively destructive act could take place without being stopped is evidence that Wikipedia had failed to govern bot behaviors and that bots in Wikipedia are out of control.

@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@NotWoods
NotWoods / split.js
Last active December 1, 2022 04:10
Node.js - Break up a stream and reassemble it so that each line is a chunk.
const stream = require("stream");
/** Simplified version of split() on npm. */
const split = new stream.Transform({
/**
* @param {Buffer | string} chunk is the data from the Readable Stream.
* @param {string} encoding is the file encoding, but isn't used here.
* @param {() => void} next is a callback function called when you finish working
* with this chunk.
*/
@Thinkscape
Thinkscape / EffectiveUrlMiddleware.php
Last active October 4, 2022 18:30
getEffectiveUrl() replacement for Guzzle 6.*
<?php
namespace Thinkscape\Guzzle;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
class EffectiveUrlMiddleware
{
/**
* @var Callable
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"