Skip to content

Instantly share code, notes, and snippets.

View Shou's full-sized avatar

Benedict Aas Shou

  • London, United Kingdom
View GitHub Profile
@Shou
Shou / README.md
Last active October 2, 2023 00:09
PureRef nixpkg

PureRef nixpkg

This is a hacky appimage wrapper nixpkg for PureRef to integrate it into NixOS better. As you may know, it's donationware, so the author encourages a donation and this means there's no way around manually downloading the program. So as a prerequisite, you need to download PureRef separately and slap it in the same folder as the Nix file, or alternatively, change the path to an absolute one, e.g.

src = /home/you/Downloads/PureRef-1.11.1_x64.Appimage;

Ideally this would use the actual Nixpkg appimage build tooling... but that's effort, and I just want to get shit done right now and this works fine.

Usage

@Shou
Shou / README.md
Last active March 21, 2021 15:50
jsplacement nixpkg

This is a nixpkgs derivation of jsplacement. Because it uses electron_4 I've decided against any effort to publish it into nixpkgs itself, but at least being here someone can add it to their Direnv default.nix or home-manager or similar.

@Shou
Shou / README.md
Last active November 27, 2019 22:05

Gets you a functional GNOME3 on Xorg. The only unusual option otherwise is that Pulseaudio broadcasting is possible (may require additional configuration through paprefs).

Following the NixOS install with encrypted /boot /root with single password unlock Gist instructions for installation.

In the future, I may use this guide instead, because it uses LUKS on LVM instead of vice versa (LVM on LUKS). LUKS on LVM is more flexible, according to the Arch wiki linked in that post:

Tip: Unlike LVM on LUKS, this method allows normally spanning the logical volumes over multiple disks.

@Shou
Shou / setup.sh
Last active May 20, 2019 10:06
My Ubuntu setup script
echo "Making dev directories"
mkdir -p ~/Prog ~/Build ~/.config/fish ~/.ghc
echo "Apt: installing dev tools+libs"
sudo apt update
sudo apt install -y curl git libfreetype6-dev libfontconfig1-dev \
xclip apt-transport-https ca-certificates software-properties-common libgmp3-dev
sudo usermod -a -G docker $USER
echo "Apt: installing Firefox" # we can probably install this with nix
@Shou
Shou / pascal.hs
Created June 6, 2018 11:16
Pascal exercises
pascal :: Int -> [[Int]]
pascal n = take n $ snd (foldl go ([], []) [0 .. n])
where
go :: ([Int], [[Int]]) -> Int -> ([Int], [[Int]])
go ([], []) _ = ([1,1], [[1], [1,1]])
go (lst, xs) _ = let newLst = sub lst False in (newLst, xs ++ [newLst])
sub :: [Int] -> Bool -> [Int]
sub (first : second : rest) False = 1 : first + second : sub (second : rest) True
sub (first : second : rest) True = first + second : sub (second : rest) True
@Shou
Shou / discord_webm.user.js
Last active July 10, 2022 20:02
Discord WebM embedder
// ==UserScript==
// @name Discord WebM embed
// @description Embeds uploaded and linked WebM files
// @namespace Shou
// @include https://discordapp.com/channels/*
// @version 1
// ==/UserScript==
var styleElem;
@Shou
Shou / discord.css
Created May 15, 2016 17:16
Collapse Discord channels bar, show on hover of guild bar
.channels-wrap
{ max-width: 0px
; overflow: hidden
; transition: max-width 0s ease-in-out
}
.channels-wrap:hover,
.channels-wrap:focus
{ max-width: 50rem
@Shou
Shou / wifiUnlock.zsh
Last active September 22, 2015 15:09
GNOME Wi-Fi auto-wake and unlock screen
#!/bin/zsh
# SETUP
# Device MAC address
MAC="FF:FF:FF:FF:FF:FF"
# IP subnet range
RANGE="192.168.0.0/27"
timeout=1.0
// ==UserScript==
// @name FuckSteam
// @description Automatically pass link warnings of Steam
// @version 0.1
// @include http*://steamcommunity.com/linkfilter/*
// @author Shou
// @copyright 2014, Shou
// @license GPL-3
// @run-at document-start
// ==/UserScript==
@Shou
Shou / Light.css
Last active August 29, 2015 14:02
Light.css
@font-face
{ src: url(https://s3.amazonaws.com/Shoufonts/Condiment-Regular.woff) format('woff')
; font-family: "Condom"
}
@font-face
{ src: url(https://s3.amazonaws.com/Shoufonts/Asap-Regular.woff) format('woff')
; font-family: "AssApp"
}