Skip to content

Instantly share code, notes, and snippets.

View masonmark's full-sized avatar
🕺
totally

Mason masonmark

🕺
totally
View GitHub Profile
@masonmark
masonmark / zfs-delegate-all.sh
Last active November 30, 2023 09:38 — forked from leopd/zfs-delegate-all.sh
Delegating all permissions to myself on zfs
export ZFS_FILESYSTEM=fixme_whatever
export ZFS_USER=fixme_whoever
sudo zfs allow -s @allperm allow,clone,create,destroy,mount,promote,receive,rename,rollback,send,share,snapshot $ZFS_FILESYSTEM
sudo zfs allow $ZFS_USER @allperm $ZFS_FILESYSTEM
@masonmark
masonmark / zfs_bug_15526_reproducer.sh
Last active November 25, 2023 05:54
zfs_bug_15526_reproducer.sh
#!/bin/bash
# masonmark 2023-11-25
#
# This is my modified reproducer.sh for https://github.com/openzfs/zfs/issues/15526
# Original: https://gist.github.com/tonyhutter/d69f305508ae3b7ff6e9263b22031a84#file-reproducer-sh
#
# This is my modified reproducer script, which just fixes the typo in
# the example command and comments out the initial if block. I did
# not need zfs_bclone_enabled to be set (the orginial script got a
<html>
<head>
<meta charset="UTF-8">
<meta name="generator" content="Screenotate 3.0.0">
<title>Honoring Boris Nemtsov on the Seventh Anniversary of his Murder - United States Department of State, 2022-02-28 at 3.40.25 PM</title>
</head>
<body>
<div>
<img height="293.0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABX4AAAJKCAYAAACbAF1YAAABRGlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8bAxCDDwM5gwiCVmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsgshSo3vkfPFBaL5Ats0jistQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEODxcVcICVMIDnYOMiLgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYER0EpQmENUfxYDhyWj2CmEWL4VA4PFCQYG5qkIsSSg37bfZGCQ5EaIqQDDmj+egWFbb0FiUSLcAYzfWIrTjCEeY+QpYmBg/fH//2dZBgb2XQwMf4v+//899///v0uA5gPNO1AIAF+IXqFPFjSiAAAAbGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAAqACAAQAAAABAAAFfqADAAQAAAABAAACSgAAAAC3LyDqAAAACXBIWXMAABYlAAAWJQFJUiTwAABAAElEQVR4Aey9CaBlRXUuvM45d556HphpUAQFFBU1zk
[
"https://twitter.com/masonmark/status/714070652",
"https://twitter.com/masonmark/status/1316546416",
"https://twitter.com/masonmark/status/22150795488",
"https://twitter.com/masonmark/status/22151113217",
"https://twitter.com/masonmark/status/41495917286658048",
"https://twitter.com/masonmark/status/42146325457944576",
"https://twitter.com/masonmark/status/42394383559045121",
"https://twitter.com/masonmark/status/46095265169539073",
"https://twitter.com/masonmark/status/46955542752673792",
@masonmark
masonmark / reference-subclass-type-in-inheritied-static-method.ts
Last active September 28, 2019 23:09
How to reference a subclass type in an inheritied static method in TypeScript
/**
* Mason 2019-09-29: This is one way to allow subclasses to inherit a
* method with a parameter whose type refers to the actual subclass type
* (and not the parent class's type).
*
* One purpose here is to define a base class, that can have various
* subclasses, and enable all of the subclasses to inherit a class method
* named configure(), which creates an instance of the subclass and then
* configures the instance and its various subclass-specific properties.
@masonmark
masonmark / static-class-method-that-references-subclass-type-try-2.swift
Created September 28, 2019 22:22
One way to let a subclass inherit a method referencing its own type in Swift (slightly improved)
// Mason 2019-09-29: This is one way to allow subclasses to inherit a
// method with a parameter whose type refers to the actual subclass type
// (and not the parent class's type).
//
// One purpose here is to define a base class, that can have various
// subclasses, and enable all of the subclasses to inherit a class method
// named configure(), which creates an instance of the subclass and then
// configures the instance and its various subclass-specific properties.
//
// The improvements are based on feedback in this thread on the Swift forum:
@masonmark
masonmark / static-class-method-that-references-subclass-type.swift
Last active September 28, 2019 22:23
One way to let a subclass inherit a method referencing its own type in Swift
// NOTE: this first attempt has been superseded by a slightly better one:
// https://gist.github.com/masonmark/967ec16161d6e0b26e146f32c2f35898
// Mason 2019-09-28: This is one way to allow subclasses to inherit a
// method with a parameter whose type refers to the actual subclass type
// (and not the parent class's type).
//
// One purpose here is to define a base class, that can have various
// subclasses, and enable all of the subclasses to inherit a class method
// named configure(), which creates an instance of the subclass and then
@masonmark
masonmark / screenshot_example.js
Last active April 13, 2017 13:56
example of a function to take a screenshot from within a Protractor 5 ( / Selenium 3) test case
function takeScreenShot(optionalFileNameFragment) {
return browser.takeScreenshot().then(function (pngData) {
var fragment = '' + (optionalFileNameFragment || "screenshot");
var now = new Date();
var fullName = fragment + "-" + now.toISOString() + ".png";
var fullPath = (process.env.CIRCLE_ARTIFACTS || "/tmp") + "/" + fullName;
var stream = fs.createWriteStream(fullPath);
stream.write(new Buffer(pngData, 'base64'));
stream.end();
@masonmark
masonmark / fuckery.js
Last active April 8, 2017 07:10
chromedriver bug workaround
function clickElementById(id, timesTriedAlready) {
// var elem = element(by.id(id));
// elem.click();
// TRY: https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/2766#issuecomment-191963206
// Mason 2017-04-08
var elem = element(by.id(id));
@masonmark
masonmark / run_circle_ci.rb
Created April 4, 2017 10:12
A script to trigger a CircleCI 2.0 build without actually committing and pushing to GitHub
#!/usr/bin/env ruby
# This script is for when you are tweaking the .circleci/config.yml file itself, and don't
# want to have to actually push a bunch of changes to the project master repo each
# time you want to test a change to the config. (Using this will also reduce spam from any
# bots that might be watching for git spam, and so on...)
#
# Adapted from: https://discuss.circleci.com/t/efficiently-testing-configuration-file-migrating-to-2-0/11620/2
#
# Assuming a project using GitHub, running this file will trigger CircleCI (2.0 platform) without