Skip to content

Instantly share code, notes, and snippets.

View nilskoppelmann's full-sized avatar
👨‍💻

Nils Koppelmann nilskoppelmann

👨‍💻
View GitHub Profile
@nilskoppelmann
nilskoppelmann / distractionless-youtube.css
Created March 7, 2023 12:02
Distractionless Youtube
/* Youtube Home */
.ytd-browse #primary {
display: none;
}
ytd-guide-section-renderer:not(:nth-child(1), :nth-child(2)) {
display: none;
}
#footer {
@nilskoppelmann
nilskoppelmann / countingSort.py
Last active July 17, 2016 17:26
Counting Sort Python (for positive numbers only)
def counting_sort(a, mn, mx):
mx = max(a) if mx > max(a) else mx
count, result = [0] * (max(a) + 1), []
i, j = 0, mn
while i < len(a):
count[a[i]] += 1
i += 1
while j <= mx:
result += [j] * count[j]
j += 1
@nilskoppelmann
nilskoppelmann / gist.js
Created March 5, 2016 14:08
get current (after change) value of select on change
$('select#f').addEventListener('change', function(e) {
console.log(this.options[this.selectedIndex].value);
}, false);
@nilskoppelmann
nilskoppelmann / minimalism.go
Created February 1, 2016 17:08
The 30-day minimalism challenge in Go
package main
import "fmt"
func main() {
helper := 0
out := 0
for i := 1; i <= 30; i++ {
if i == 1 {
@nilskoppelmann
nilskoppelmann / keybase.md
Created January 13, 2015 23:25
keybase.md

Keybase proof

I hereby claim:

  • I am nilsology on github.
  • I am nilsology (https://keybase.io/nilsology) on keybase.
  • I have a public key whose fingerprint is F723 3BAF CF27 6695 CDE8 4A36 FAEB C3CB 07B6 8375

To claim this, I am signing this object:

@nilskoppelmann
nilskoppelmann / .netConList
Last active August 29, 2015 14:13
netCon - neat tool to test network connections
#example list of severs/sites to ping
blog.fefe.de
google.com
spiegel.de
@nilskoppelmann
nilskoppelmann / README.md
Created January 13, 2015 20:34
"Tools" to download stuff from wordpress.com sites ... mainly to backup media

Please follow the instructions to backup "all" the media of one wordpress.com instance.

Go to https://your-blog.wordpress.com/wp-admin/upload.php

  • Click the first media item and then as the pop-up appears, right-click on the right-arrow/next-arrow (>) in the top-right-hand corner and select "Inspect Element".
  • Replace this button and the it contains with the corrosponding one you find in next-btn.html (this directory). This procedure my vary depending on the type of browser you use.
  • Go to your browsers Javascript console and initialize the path variable path by typing: path = "";
  • The pop-up still open: click through all the pictures/media-files until you reach the end. Never close the pop-up or you have to start all over again.
  • When you have reached the last picture, paste the following code into the Javascript console: var el=document.querySelector('div.settings label.setting:first-child input'); path += '\n' + el.value;
@nilskoppelmann
nilskoppelmann / README.md
Last active August 29, 2015 14:13
Create gpg-lists to hand out at crypto parties

GPG-Party-Lists

##Usage: gpgkeylabel -k KEYID
To get a listing:
gpgkeylabel -l -k KEYID
and then to convert this to a pdf to finally be able to print it out
you will need [phantomjs] (https://github.com/ariya/phantomjs/) and [makepdf.js] (https://gist.github.com/philfreo/5854629) and should use the following:
gpgkeylabel -l -k KEYID | phantomjs ../makepdf.js > yourListing.pdf

@nilskoppelmann
nilskoppelmann / README.md
Last active August 29, 2015 14:13
Jukebox which plays sounds on keypress

jukebox

Jukebox which plays sounds on keypress

How to configure

In the configuration-file .jukeboxrc you mainly can set the desired location in which the sound-files are located and you have to set a few parameters for each "sound-effect".

@nilskoppelmann
nilskoppelmann / pwdgen.sh
Last active August 29, 2015 14:13
simple password generator
#!/bin/sh
# usage: ./pwdgen.sh [keysize]
keyfile=file
ssh-keygen -t rsa -f $keyfile -b 1024 -N '' -v &> /dev/null
totallinenumbers=$(grep -c ".*" $keyfile)
linenumber=$(echo $(($RANDOM % $(expr $totallinenumbers - 2) + 2 | bc)))
echo $(sed -n $(echo $linenumber)p $keyfile) | fold -w $(echo $1)| cat -b | sort -rn | cut -f2- | tail -1
rm $keyfile $keyfile.pub