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 / gist:4597959
Created January 22, 2013 20:08
filthy
# foldr applies the first argument, a function which takes two arguments, to
# the accumulator z, whose value changes on each for-loop iteration, and x,
# which is the current iteration's element of the xs list.
def foldr(f, z, xs):
for x in xs: z = f(z, x)
return z
# A version of foldr that takes no starting value, z, and instead uses the first
# argument in the list as the starting value.
# Raises an exception when an empty list is passed.
@Shou
Shou / Dark.css
Created November 25, 2013 04:06
Dark theme for Zetaboards
html, body
{ background: #101010
; background-image: url("http://a.pomf.se/A6g8P4.png")
; background-repeat: repeat
; color: #d0d0d0
; font-family: "Avant Garde", "Century Gothic", sans-serif
; font-size: 10pt
; margin: 0
; padding: 0
}
@Shou
Shou / hexip.user.js
Created January 4, 2014 13:39
XChat nick-style highlighting for IP addresses on Zetaboards
// ==UserScript==
// @name HexIP
// @description i recognize that IP address!
// @version 0.1.1
// @include http*://*.zetaboards.com/*/topic/*
// @author Shou
// @copyright 2013, Shou
// @license GPL-3
// ==/UserScript==
@Shou
Shou / Dark.css
Last active August 29, 2015 14:02
Dark CSS
@font-face
{ font-family: "Lobster"
; src: url(https://s3.amazonaws.com/Shoufonts/lobster_1.3-webfont.woff)
}
@font-face
{ src: url(https://s3.amazonaws.com/Shoufonts/Asap-Regular.woff) format('woff')
; font-family: "AssApp"
}
@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"
}
// ==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 / 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
@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 / 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 / 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