Skip to content

Instantly share code, notes, and snippets.

View nilsding's full-sized avatar
🐾
fox paws

Georg Gadinger nilsding

🐾
fox paws
View GitHub Profile
@nilsding
nilsding / personalvoice.swift
Created October 12, 2023 14:32
allow Terminal to access your personal voice
// usage: swift ./personalvoice.swift
//
// after accepting the prompt you can use your personal voice using `say` like this:
// % say -v "Jyrki" "I sure like being inside this fancy computer."
// (replace "Jyrki" with the name of your personal voice, use `say -v '?'` for a list of available voices)
import AVFoundation
if #available(macOS 14.0, *) {
let authorisationStatus = await AVSpeechSynthesizer.requestPersonalVoiceAuthorization();
@nilsding
nilsding / cMss.py
Last active April 28, 2023 13:21
cmss.py - an early 2009 minecraft server script (not made by me)
#!/usr/bin/env python
# cryzed's Minecraft server script
# Copyright (C) 2009 cryzed
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@nilsding
nilsding / pre-commit
Created July 3, 2018 09:49
shellcheck pre-commit hook
#!/usr/bin/env bash
# Print a message
#
# Params:
# $1: colour (red | green | yellow)
# $*: status to print
#
# Example usage:
# print_msg green "Successfully built $something"
@nilsding
nilsding / jsonfs.rb
Created November 17, 2014 18:40
JSONfs - the JSON file system
#!/usr/bin/ruby
# JSONfs - the JSON file system
# (c) 2014 nilsding
# License: GPLv2
#
# Requires RFuse, install it via `gem install rfuse`
#
# Based on the RFuse sample file system:
# https://github.com/lwoggardner/rfuse/blob/master/sample/test-ruby.rb
# (c) 2014 lwoggardner
# Cursed ways to return 5 without using 0123456789+-*/
[[],[],[],[],[]].size # => 5
Array(?;..??).size # => 5
module Solution3
def self.method_missing(name)
return name.size if name =~ %r{^.....$} # => 0
super
html {
background: #31adab;
overflow: hidden;
height: 100vh;
background-attachment: scroll;
background-position: bottom 30px left 30px;
background-repeat: no-repeat;
background-image: url(
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAA8CAYAAAD7e5PeAAABlElEQVRoge2Xa7LDIAiFWTxrc1v2R64dQxBRD625zZlh2lgiX4/xESKfclBAlSlnbBBlZoaChjgZAMmZKAM/QyCPAkXroEFOHnBHoQI6DxzkJMbBrzv53SXJ+UwuLFUYSN8QrsTq8Lsnw6xAkD4nvUB1zEIiJoEaSCfxe/UfSEppfydTSjgnIwR3UnZed9hrZ+ZSUIVs/YFlyPrzBKnAHMX0/BAntQ577bWT8rcQJ+tiqpMdeA0S7iRSYU5arnh/k5C/6WQRi7151kkrIEsQn86TBaAxoXI5c+ozvxVTkEz8DhVGcd1yEvnKcCmMUBgkgWf37zkZFdDX2N4sXAkY5KNHj2xpS8V20qC2A709pBz+1iOhPS6ee3v3NAvITlp/Jg+293KsWq7ORmCsds25bSBHc/43ZLkemTgjOSYkWtstX0Q32K0e1WoN0VZDdxvI1nKxjbyQ1t7uzZft3gPIZWEdPSB4FuGZff7U7oX07ioz+TK3Cen9LjuPaL/U3RHSdFJLrK9Xh9vb3mP7qLaAkJo6jLwAB8WGP5NN1tMAAAAASUVORK5CYII='
);
@nilsding
nilsding / bot.rb
Created September 14, 2014 15:39
#!/usr/bin/env ruby
# bot.rb - simple Twitter retweet bot
# See also: http://blog.nilsding.org/blog/2014/09/14/retweetbot-tutorial/
#
# code (c) 2014 nilsding
# License: WTFPL
require 'twitter'
retweet_tags = ["#nilsding", "Fuchs"] # the tags the bot should retweet
@nilsding
nilsding / .bashrc
Last active April 23, 2017 15:04
The Windows user friendly .bashrc™
# The Windows user friendly .bashrc™
# (c) 2013-2014 nilsding
# License: public domain
# Feel free to fuck around with this.
# Test for an interactive shell.
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
// ==UserScript==
// @name Remove Emo mode
// @namespace org.nilsding.remove-github-emo-mode
// @include https://github.com/*
// @include https://*.github.com/*
// @version 1
// @grant none
// ==/UserScript==
document.getElementsByClassName("header")[0].classList.remove("header-dark")