Skip to content

Instantly share code, notes, and snippets.

@drproteus
drproteus / gruvbox-cmd-colours.reg
Created May 20, 2017 19:37 — forked from leafgarland/gruvbox-cmd-colours.reg
Set Windows cmd window colours, based on gruvbox for vim https://github.com/morhetz/gruvbox
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console]
"ColorTable00"=dword:00282828
"ColorTable01"=dword:00888545
"ColorTable02"=dword:001a9798
"ColorTable03"=dword:006a9d68
"ColorTable04"=dword:001d24cc
"ColorTable05"=dword:008662b1
"ColorTable06"=dword:002199d7
class UpdatedManager(models.Manager):
"""
Model manager mixin providing a filter to check for
models modified in a certain range, or from creation.
Accepted optional column aliases for when a model has
a timestamp column named differently than the standard
created/updated_at.
"""
class Meta:
@drproteus
drproteus / ducky.md
Created January 14, 2019 01:09 — forked from schmich/ducky.md
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

Keybase proof

I hereby claim:

  • I am drproteus on github.
  • I am drproteus (https://keybase.io/drproteus) on keybase.
  • I have a public key ASD3zyW7zzSrTUDor7c0VegQSvDw9BCEPUPslWEgJiaKqAo

To claim this, I am signing this object:

// derived from https://blog.bitsrc.io/build-a-command-line-progress-bar-in-node-js-5702a3525a49
// working on some system monitoring tools using the systeminformation lib,
// this an initial stab at getting some graphical feedback on CPU load in the term.
// not sure if super buggy wrt screen clear or just windows terms misbehaving.
const si = require("systeminformation");
const process = require("process");
const rdl = require("readline");
class PercentageMeterBar {
<html>
<head>
<title>My Really Cool Site</title>
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous">
<style>
#header {
height: 124px;
@drproteus
drproteus / stream.sh
Last active July 9, 2020 13:40
Stream to Twitch.tv via ffmpeg
#!/bin/bash
ffmpeg -re -i "$1" \
-vcodec libx264 \
-preset:v veryfast \
-r 30 -g 60 -keyint_min 60 \
-sc_threshold 0 -b:v 2500k \
-maxrate 2500k -bufsize 2500k \
-filter:v scale="trunc(oh*a/2)*2:720" \
-acodec aac -b:a 96k \
-ar 44100 -ac 2 -f flv -threads 0 \
@drproteus
drproteus / graphene.py
Created August 24, 2020 18:00 — forked from mixxorz/graphene.py
Get requested fields from ResolveInfo. Graphene python.
"""
MIT License
Copyright (c) 2018 Mitchel Cabuloy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@drproteus
drproteus / bully.sh
Last active January 17, 2022 18:08
/dev/bull
#!/bin/bash
BUFFER=/tmp/bullbuffer.img
if [[ -f "$BUFFER" ]]; then
echo "Buffer exists"
else
dd if=/dev/zero of=$BUFFER bs=100M count=1
fi
{
"editor.fontFamily": "Cascadia Code PL, Consolas, 'Courier New', monospace",
"vim.handleKeys": {
"<C-d>": true,
"<C-c>": false,
"<C-w>": false,
"<C-s>": false,
"<C-b>": false,
"<C-j>": false,
"<C-\\>": false,