Skip to content

Instantly share code, notes, and snippets.

@frontierpsycho
frontierpsycho / clean-fortunes.sh
Last active February 14, 2021 10:20
Disable some fortune databases
#!/bin/bash
# replace with your least favourite fortune databases
COLLECTIONNAMES=('zippy' 'knghtbrd' 'misogyny' 'racism' 'misandry' 'hphobia')
FORTUNES_DIRECTORY=/usr/share/games/fortunes
OFFENSIVE_FORTUNES_DIRECTORY=${FORTUNES_DIRECTORY}/off
for collection in "${COLLECTIONNAMES[@]}"; do
echo "=================="
echo "Disabling ${collection}"
@frontierpsycho
frontierpsycho / restore-fortunes.sh
Created February 14, 2021 10:20
Restore disabled fortune databases (in case it's needed to update the package)
#!/bin/bash
# replace with your least favourite databases
COLLECTIONNAMES=('zippy' 'knghtbrd' 'misogyny' 'racism' 'misandry' 'hphobia')
FORTUNES_DIRECTORY=/usr/share/games/fortunes
OFFENSIVE_FORTUNES_DIRECTORY=${FORTUNES_DIRECTORY}/off
for collection in "${COLLECTIONNAMES[@]}"; do
echo "=================="
echo "Restoring ${collection}"
@frontierpsycho
frontierpsycho / index.ts
Last active October 5, 2016 14:44
Typescript bug demonstration #2
class TestClass {
makeFunction(): (someCondition: boolean) => boolean {
return (someCondition: boolean = false) => {
return someCondition;
}
};
}
let test = new TestClass();
@frontierpsycho
frontierpsycho / index.ts
Last active October 5, 2016 14:42
Typescript bug demonstration #1
class TestClass {
makeFunction(): (someCondition: boolean) => boolean {
return (someCondition: boolean = false) => {
return someCondition;
}
};
}
let test = new TestClass();
@frontierpsycho
frontierpsycho / batch_channel_example.go
Created October 21, 2015 15:15
BatchChannel example
package main
import (
"fmt"
"strings"
)
var batchSize int = 2
func main() {