Skip to content

Instantly share code, notes, and snippets.

Avatar
🐾
obey the laws rub my paws

Georg Gadinger nilsding

🐾
obey the laws rub my paws
View GitHub Profile
@nilsding
nilsding / pre-commit
Created Jul 3, 2018
shellcheck pre-commit hook
View pre-commit
#!/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 Nov 17, 2014
JSONfs - the JSON file system
View jsonfs.rb
#!/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
View cursed5.rb
# 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
View nicer-nginx-dirlisting.css
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='
);
View bot.rb
#!/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 Apr 23, 2017
The Windows user friendly .bashrc™
View .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
View remove-github-emo-mode.js
// ==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")
View RootLayout.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.ToolBar?>
<?import javafx.scene.layout.AnchorPane?>
View gist:666f516377e336b2a64033d87c36a008

tlImorCPpapyVeCoK_AcCoScNisadaAwwiluNDWaPsEacojbnoGrzewoxupoKaRonezeryOt_RLimuCrSoviTrCahomcBuWe_wAwDjwoLuWarsfuVinanomkumVeNaercoheDibuansczeadAllaheEtAeliaticksWalareRaxxluquTJjzoxagsyTulaaneiCaNeorhaomitgsmiecStNaubh3BMarkiororcaHiridaPozzJiusipcaheralantabnoabrmclDeitoyagrtblEahiudKfelckasggkicrabeciteallweINrashisWiphteetamthrecuRaanssefremonnap_wewgrMAwbpiasas_CokepinNoleJRe_anerdotsleFrplooosreLWdgarqpurantenmniUKNKngWeootehuol3Fmssearoumos_22inerthckayizreaktraae3nukuhuknunp_owucleoklfsKloacinreeYanTodokf0rlet-itndcklimmjkogataroxunernstOrjttonloenotshipsteangpeyEaqmpm1htrslmaycermenrrmgiachp0ulannoadussmonarenenrlscsi_oOHkkcjWAbuiRsaacomanyageinibdempblugnk_ard_oroiooneberolstHewaarinnaprsoanaeieHaheverd1okesbhackro_gtebael_dzIigorpgwaBXr_ngerceacsh_On2avarl_onthryhariadacrmmbsulsataiinoltobsackfglkisateacmizcp4esckstsaleuranaghatsalfyuivirWFiisbalagamShraxldende_Acyly97tSlkramomiicnpilRhr3riplsah2urus50hamiy_KiinboTLENuralntmainpabetupersayE__Eo2anchanfttiFiTommweranjnt30usjeveoreta1xycSymnink12NDow