Skip to content

Instantly share code, notes, and snippets.

View b0o's full-sized avatar
👻

Maddison Hellstrom b0o

👻
View GitHub Profile
@jdarpinian
jdarpinian / hello-world.shc
Last active February 6, 2018 12:17
Directly execute C source code by embedding in a bash script.
#!/bin/bash
COMPILER_OPTIONS="-g -Wall -Wextra --std=c11 -O1 -fsanitize=address,undefined"
SOURCE_CODE=$(cat <<'END_OF_SOURCE_CODE'
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}
@sgf-dma
sgf-dma / fix-mupdf-fullscreen-xmonad.hs
Created March 6, 2017 20:08
fix-mupdf-fullscreen-xmonad.hs
import Data.Maybe
import Control.Monad
import XMonad
import XMonad.Hooks.EwmhDesktops
addNETSupported :: Atom -> X ()
addNETSupported x = withDisplay $ \dpy -> do
r <- asks theRoot
a_NET_SUPPORTED <- getAtom "_NET_SUPPORTED"
a <- getAtom "ATOM"
@wujcheng
wujcheng / dns.md
Created August 19, 2018 06:42 — forked from roge/dns.md
Public DNS Servers

DNS.md

A list of reasonably reliable DNS servers that I've personally tested to ensure that they fully support DNSSEC and do not hijack NXDOMAIN responses.

IPv4

Address Organization Location Service
8.8.8.8 Google Worldwide (Anycast) Google Public DNS
8.8.4.4 Google Worldwide (Anycast) Google Public DNS
@zer4tul
zer4tul / weechat.md
Last active August 21, 2021 21:12
A Simple, Base16 Friendly, Weechat Setup

A Simple, Base16 Friendly, Weechat Setup

Scripts

  • Some must-have scripts
  /script install buffers.pl buffer_autoclose.py iset.pl go.py colorize_nicks.py
@rchrd2
rchrd2 / yaml2dot.py
Created April 21, 2016 05:45
YAML to Graphviz
#!/usr/bin/python
# vim: fileencoding=utf-8
u'''Translate YAML written text to graphviz dot language
Input YAML text like below:
---
foo:
'use strict';
const fs = require('fs');
const os = require('os');
const Path = require('path');
const hdns = require('hdns');
const {encoding} = require('hdns/node_modules/bcrypto');
const {pem} = encoding;
const host = process.argv[2];
@bailsman
bailsman / gist:0be72ceba495f4e3fab6
Created March 2, 2015 21:26
SSH_ASKPASS script that works without X
#!/bin/bash
set -o errexit
set -o nounset
# This script is useful when forwarding your agent to an untrusted server. It works without X.
#
# To use this script, export DISPLAY=FAKE SSH_ASKPASS=/path/to/this/script SSH_ASKPASS_TTY=$(tty)
# before you do eval `ssh-agent` (these variables should end up in the environment ssh-agent runs in)
# Then add keys to the agent with ssh-add -c /path/to/key
# ssh-agent will then call this script to ask you for confirmation when asked for that key.
@tatianamac
tatianamac / tatiana-mac-boycott-list.md
Last active August 13, 2022 00:16
Tatiana Mac's Boycott List

Brands I Boycott and Why

An ever-evolving list of brands I boycott and why as well as the last date I supported them. I'll continue to update this list as I learn more and detach myself from the firm grip of big tech and corporatism.

I recognise, as a tech worker, that we've created quite the hydra, so detaching ourselves becomes much more complicated than it ever should be. I also recognise that like the capitalistic umbrella tech operates under, we are somewhat stuck using certain technologies (for example, I am writing this here on GitHub, which refuses to drop ICE as a contract.).

I am not perfect and recognise this can be seen as moralistic. I am doing this to share information that may help influence your decisions. They may not. That's up for you to decide.

My hope is to encourage everyone to be more thoughtful in how they vote with their wallets.

Helpful Websites

# Convert from H264 to H265
ffmpeg -i in.mov -c:v libx265 -an -x265-params crf=20 output.mp4
# Tag as HVC instead of HEV1 so iOS can play it
ffmpeg -i output.mp4 -vcodec copy -acodec copy -tag:v hvc1 output2.mp4
# Bonus: it can take a second to play (no more than H264) so here's how to generate
# a thumbnail of the first frame to embed in your view as a placeholder.
ffmpeg -i output2.mp4 -vf "select=eq(n\,34)" -vframes 1 thumbnail.png
@nathansearles
nathansearles / isAutoplaySupported.js
Last active December 13, 2022 11:06
Test if HTML5 video autoplay is supported
// isAutoplaySupported(callback);
// Test if HTML5 video autoplay is supported
isAutoplaySupported = function(callback) {
// Is the callback a function?
if (typeof callback !== 'function') {
console.log('isAutoplaySupported: Callback must be a function!');
return false;
}
// Check if sessionStorage exist for autoplaySupported,
// if so we don't need to check for support again