Skip to content

Instantly share code, notes, and snippets.

@oledid
oledid / turn-off-screen.ps1
Created September 24, 2015 07:15
PowerShell: Turn off computer screen
# Source: http://www.powershellmagazine.com/2013/07/18/pstip-how-to-switch-off-display-with-powershell/
# Turn display off by calling WindowsAPI.
# SendMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST 0xffff
# WM_SYSCOMMAND 0x0112
# SC_MONITORPOWER 0xf170
# POWER_OFF 0x0002
@Denbergvanthijs
Denbergvanthijs / donut.py
Last active April 24, 2024 18:36
3D spinning donut in Python. Based on the pseudocode from: https://www.a1k0n.net/2011/07/20/donut-math.html
import numpy as np
screen_size = 40
theta_spacing = 0.07
phi_spacing = 0.02
illumination = np.fromiter(".,-~:;=!*#$@", dtype="<U1")
A = 1
B = 1
R1 = 1
@JoschD
JoschD / cern_afs_kerberos_wsl2.md
Last active April 24, 2024 18:35
AFS in WSL2 for CERN realm

AFS Kerberos at CERN from inside WSL2 (Ubuntu 20.04)

Trying to get openAFS running on WSL2 following the regular guides from OmeGak and twiki ended for me in

aklog: a pioctl failed while obtaining tokens for cell cern.ch
@jacksonthall22
jacksonthall22 / main.py
Last active April 24, 2024 18:34
Encoding position using occupancy and a mapping of piece triplets
from typing import Iterable
import itertools
import chess
pieces = [chess.Piece(p_type, c) for c in chess.COLORS for p_type in chess.PIECE_TYPES]
NUM_PIECES_IN_GROUP = 3
groups = list(itertools.product(pieces, repeat=NUM_PIECES_IN_GROUP))
BINARY_WIDTH = (len(groups) - 1).bit_length()
{ pkgs, lib, config, ... }: with lib.types;
let
postgresqlInstanceType = submodule {
options.connectionString = lib.mkOption {
type = str;
};
};
@xeoncross
xeoncross / Positive-Adjective-List.txt
Created February 23, 2016 19:19
Positive Adjective List
Positive Adjective List
abundant
accessible
accommodative
accomplished
accurate
achievable
adaptable
adaptive
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active April 24, 2024 18:32
crack activate Office on mac with license file
@dghubble
dghubble / kubeception.md
Last active April 24, 2024 18:29
Running QEMU/KVM and Nested Kubernetes on Bare-Metal Kubernetes
@hwayne
hwayne / Intro.md
Last active April 24, 2024 18:27
Securedrop TLA+ specification review

People who take my TLA+ Class get a free specification review. Cory Myers asked for a review of his Reply.tla spec, reproduced from the PR below, and has graciously agreed to let me make it public. The review itself is here.

Note this is a "light" review: I'm looking for general TLA+ antipatterns and techniques that don't require me to deeply understand the problem domain. This represents about an hour of review.

@BrokenGabe
BrokenGabe / gist:51d55a11c2090d9402e40f12a6ece275
Created December 12, 2023 15:04
uBlock Origin "My Filters"
www.youtube.com###donation-shelf
www.youtube.com##ytd-reel-shelf-renderer.ytd-item-section-renderer.style-scope
www.youtube.com##+js(set, yt.config_.EXPERIMENT_FLAGS.service_worker_enabled, false)
www.youtube.com##+js(nano-stb, resolve(1), *, 0.001)
||googlevideo.com/videoplayback$xhr,3p,method=get,domain=www.youtube.com