Skip to content

Instantly share code, notes, and snippets.

View gdejohn's full-sized avatar

Griffin DeJohn gdejohn

View GitHub Profile
@fryfrog
fryfrog / Android-SHIELD Android TV.xml
Last active November 8, 2022 18:31
A customized Plex profile for the Nvidia Shield, which goes in ./Library/Application Support/Plex Media Server/Profiles/
<!-- Put in ./Library/Application Support/Plex Media Server/Profiles/Android-SHIELD Android TV.xml -->
<!-- Author: Donald Webster fryfrog@gmail.com -->
<?xml version="1.0" encoding="utf-8"?>
<Client name="SHIELD Android TV">
<Identification>
<Header name="User-Agent" substring="SHIELD Android TV" />
</Identification>
<TranscodeTargets>
<VideoProfile container="mkv" codec="h264" audioCodec="aac" context="streaming" />
<MusicProfile container="flac" codec="flac" id="StereoMusicTranscodeProfile" />
@kazuki43zoo
kazuki43zoo / DemoMapper.java
Last active February 11, 2020 14:08
R2DBC + MyBatis
package org.mybatis.r2dbc.session;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
public interface DemoMapper {
Mono<Integer> insert(Demo demo);
Mono<Integer> insert(Mono<Demo> demo);
@cohawk
cohawk / README.md
Last active May 16, 2023 06:59
CockroachDB fork of the postgrex adapter - Elixir Ecto caveats

Over the weekend I spun up a new Elixir :ecto, "2.2.7" project that I was able to get working with CockroachDB and this adapter fork - with some caveats I wanted to share to help others.

  1. Only the root user can create databases This requires you configure the Ecto.Adapters.Postgres username as root or else the mix ecto.create command will always fail. You can go back and change your configured username to something else after the database has been created, or create your database and user permissions using cockroach sql and skip the mix ecto.create command.

  2. Configuring Ecto primary_key ID to be created by CockroachDB By default when configuring your Ecto.Schema using autogenerate: false it appears either CockroachDB, Ecto or the Postrex adapter (I did not investigate this) uses the BIGINT unique_rowid() function as the default value for IDs

@primary_key {:id, :id, autogenerate:
@0chroma
0chroma / VFIO Setup Guide.md
Last active March 12, 2024 13:49
Windows 10 VFIO QEMU Setup

VFIO Setup Guide

I play games regularly, and the sad reality is that it forces me to use Windows on my desktop. There's a Linux installation on there, but rebooting into it is such a massive interruption that I usually just move over to my laptop for programming. Working on a laptop leads to all sorts of ergonomic issues, and it felt like a massive waste to not develop on the desktop hardware I invested so much in. So after extensively researching what the VFIO community has been doing, I've deleted my Windows installation and moved all my gaming into a virtual machine on a Linux host.

Normally VMs are too slow for gaming, but thanks to a feature called VFIO you can run games at near-native performance by passing graphics cards and USB controllers directly to a virtual machine. The only requirement is that your board supports IOMMU, which most modern systems have. In this guide I'll wal

#!/bin/vbash
# CONFIG
wan=dhcp
lan=192.168.1.1
lan_segment=192.168.1.0
vpn_segment=192.168.5.0
domain=apertoire.org
lease_start=192.168.1.200
lease_stop=192.168.1.245
@smarr
smarr / truffle-material.md
Last active May 14, 2024 07:48
Truffle: Languages and Material
@gdejohn
gdejohn / Poker.hs
Last active February 28, 2024 12:32
Calculate exact equity for Texas hold 'em by exhaustive enumeration.
module Poker (Rank(..), Suit(..), Card, rank, suit, Hand, hand, equity) where
import Control.Applicative ((<**>))
import Data.Function (on)
import Data.List ((\\), foldl1', group, sortOn)
import Data.Ord (Down(Down))
import Data.Ratio ((%))
data Rank = Two
| Three
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 25, 2024 19:14
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@christianberg
christianberg / Dockerfile
Last active January 10, 2023 16:58
Sharing a unix socket between a Docker container and it's host
FROM ubuntu
RUN apt-get update
RUN apt-get install -y socat
VOLUME /foo
CMD socat UNIX-LISTEN:/foo/bar.sock -
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.