Skip to content

Instantly share code, notes, and snippets.

@hannic
hannic / compliments.json
Last active May 2, 2024 17:05
magicmirror - compliments.json
{
"anytime": [
"Nasta prieschta",
"Houdärä",
"Mit wehnenden Fahnen",
"Let's do scissors",
"seebilicious",
"The Oppsoyo Problem",
"Asshh gabat",
"The last eternity",
@hannic
hannic / .block
Last active April 30, 2020 10:39
Host Single Page Websites on Gist (bl.ocks.org and https://bl.ocks.org/-/about)
license: gpl-3.0
height: 500
scrolling: no
border: yes
To add a thumbnail
@hannic
hannic / README-Template.md
Last active May 6, 2020 10:37 — forked from anantbahuguna/README-Template.md
A template to make good README.md

📓 Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@hannic
hannic / how-to-download-movie-from-srf.md
Last active December 7, 2019 18:30
How to download sliced mpeg movie stream

how-to-download-movie-from-srf

Check Network Request

Analyze the request and response

  • seems as the movie stream is sliced up in many .ts files with just a few seconds

  • m3u file found: index_0_av.m3u

      #EXTM3U
    

#EXT-X-TARGETDURATION:10

@hannic
hannic / .wp_wp-cli.sh
Last active December 29, 2017 17:39
wp-cli
# WP-CLI - Commands
wp help <befehl>
# update wordpress installation and its database
wp core update
wp core update-db
# update plugins and themes
wp plugin update --all
wp theme update --all
@hannic
hannic / .shell_commands_available.sh
Last active December 29, 2017 17:38
Lists all commands available on Unix
compgen -c # will list all the commands you could run.
compgen -a # will list all the aliases you could run.
compgen -b # will list all the built-ins you could run.
compgen -k # will list all the keywords you could run.
compgen -A function # will list all the functions you could run.
compgen -A function -abck # will list all the above in one go.
@hannic
hannic / ssh_rsa_key.sh
Last active August 13, 2017 06:45
Setup private and public keys
# Forgotten passphrase for private ssh key
# you need to remove your SSH public/private keys, recreate them,
# and then add your newly created public key to the servers
# and online services you use.
# Remove your SSH public/private keys:
rm ~/.ssh/id_rsa*
# Recreate the keypair, choosing a new passphrase:
ssh-keygen -t rsa -f ~/.ssh/id_rsa
@hannic
hannic / .applescript_first_page_pdf.AppleScript
Last active December 29, 2017 17:37
Extract first page of PDF as JPG image
# Extract first page of PDF as JPG image
# e.g. for creating thumbnails of pdf
# for use in OS X Terminal
# get the first page of a PDF as an image, e.g. its cover image
sips -s format jpeg /Users/<username>/Desktop/Python_for_Data_Analysis.pdf -o /Users/<username>/Desktop/cover.jpg
!! - Last command
!foo - Run most recent command starting with 'foo...' (ex. !ps, !mysqladmin)
!foo:p - Print command that !foo would run, and add it as the latest to command history
!$ - Last 'word' of last command ('/path/to/file' in the command 'ls -lAFh /path/to/file', '-uroot' in 'mysql -uroot')
!$:p - Print word that !$ would substitute
!* - All but first word of last command ('-lAFh /path/to/file' in the command 'ls -lAFh /path/to/file', '-uroot' in 'mysql -uroot')
!*:p - Print words that !* would substitute
^foo^bar - Replace 'foo' in last command with 'bar', print the result, then run. ('mysqladmni -uroot', run '^ni^in', results in 'mysqladmin -uroot')