Skip to content

Instantly share code, notes, and snippets.

Mark Dain ancarda

View GitHub Profile
View umatrix
* ajax.aspnetcdn.com script allow
* ajax.googleapis.com script allow
* cdn.jsdelivr.net script allow
* cdn.polyfill.io script allow
* cdnjs.cloudflare.com script allow
* code.jquery.com script allow
View degree.txt
* STAGE1 [======= ] 68%
TM111 [==========] 100%
MU123 [==========] 100%
TM112 [=== ] 30%
TM129 [==== ] 40%
* STAGE2 [ ] 0%
S2_M1 [ ] 0%
S2_M2 [ ] 0%
S2_M3 [ ] 0%
S2_M4 [ ] 0%
View yaml.md

Pretty print a file with yq:

yq r -CP -I 4 file.yml
View 9612F6C792C9FB402EA61AC1A440BD5CDE5CA1F7.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF6jlWkBEAC3NG5We7OwtIjJHvw/Hx/pDUohWT4SQUy3WVs2808L1cDQyXT3
WpSSeBe7J17G3GZebP5c0ipuAvf20MhKJHpHKxJ3gEL92qK0ckawY6YhONu7bl0N
6JH/lPKuNtiENN7WX0QRU8ylXdkJ4Habak8B0975c1L1dEq6zK6+41x2Ig3Eg3RF
QSo1KL2x4UFNK1OqCW9exHosEcmveG3mFRN5mjtKzGk8VPW8gl8cBON2Z4Nx80EZ
xcYPXgCzZaEd0a0ekLTs921Ve9ob7X0EwYy1XND6f3NqeZVd/B9gCDfLf3rdbQFn
HAqQeiXbNI0JsK4alg2OAqP1i1YpbszYNeERqYec1uqPWEnrX94dm6OnAWUO3CsK
SSKz7x47OJR05vWThFb52d2vCwEGdqs9Svro83GTpT9l7RdNHJHE3ZG/ITgvPSTW
QmPskF4r3kYlHhoNQXVEBFuACzkoeKMAmuSyMYYfDnyAxJ2LBy1F7Nqb6bD1NaQ3
View wg-dns-txt-parser.php
<?php
class WireGuardConfig
{
public int $version;
public string $pubkey;
public ?int $port;
View wsl-mount-network-share.sh
# Mount network share in WSL
cd /mnt
sudo mkdir z
sudo mount -t drvfs z: z
View dont-freeze.sh
stty stop '' # disable that annoying Ctrl-S
stty start '' # in which case Ctrl-Q is kinda useless
View ascii_copy.c
/**
* This script implements a very simple string copy that is the same length
* or less bytes. The copied string only contains printable characters.
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
View no-errors.php
<?php
// catch everything
set_error_handler(function (int $errno, string $errstr, string $errfile = 'unknown', int $errline = 0, array $errcontext = []) {
echo("<p>$errfile:$errline</p>\n");
echo("<p>[#$errno] $errstr</p>\n");
print_r($errcontext);
exit(1);
});
View tests.php
<?php
public function providerPsr7Implementations(): array
{
$guzzle = \GuzzleHttp\Psr7\stream_for(static::TEST_STRING);
return [
[StringStream::class, new StringStream(static::TEST_STRING)],
[get_class($guzzle), $guzzle],
[\Nyholm\Psr7\Stream::class, \Nyholm\Psr7\Stream::create(static::TEST_STRING)],
You can’t perform that action at this time.