Skip to content

Instantly share code, notes, and snippets.

View JohannesFischer's full-sized avatar

Johannes Fischer JohannesFischer

View GitHub Profile
# ~/.bashrc: executed by bash(1) for non-login shells.
# run after updating: source ~/.bashrc
# some lazy ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Alias definitions.
# You may want to put all your additions into a separate file like
@JohannesFischer
JohannesFischer / npm.sh
Last active September 6, 2016 01:24
Useful npm commands
# Go to package repo page
npm repo $package
# Go to package home page
npm home $package
# List outdated packages
npm outdated
# Remove extraneous packages
@JohannesFischer
JohannesFischer / snippets.cson
Last active October 6, 2016 02:43
My Atom Snippets
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@JohannesFischer
JohannesFischer / git-commands.md
Last active October 7, 2025 01:00
List of useful git commands

GIT cheatsheet

Basics

Set upstream

git branch --set-upstream-to=upstream/branchname

Fetch without tags

git fetch upstream -n

@JohannesFischer
JohannesFischer / settings.json
Last active September 10, 2018 07:04
My Visual Studio Code User Settings
// Place your settings in this file to overwrite the default settings
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.wordWrap": "off",
"editor.detectIndentation": false,
"files.associations": {
"*.css.erb": "css",
"*.ejs": "html",
"*.pac": "javascript",
@JohannesFischer
JohannesFischer / RegEx
Last active February 17, 2017 02:39
RegEx I think I will use again
# CSS
# add missing semicolon to last property
([^;])$(\n})
$1;$2
# Shorten hex color values
#([\da-f])\1([\da-f])\2([\da-f])\3\b
#$1$2$3
@JohannesFischer
JohannesFischer / javascript.json
Last active February 23, 2017 02:04
VS Code Snippets [javascript]
{
"Print to console": {
"prefix": "conl",
"body": [
"console.log($1);"
],
"description": "Log output to console"
},
"Print info to console": {
"prefix": "coni",
@JohannesFischer
JohannesFischer / pre-commit
Last active December 6, 2017 23:48
Git pre commit hook - test modified files with ESLint and Rubocop and for focus tags in spec files
#!/bin/sh
FILE_COUNT=$(git status | grep 'modified:' | wc -l)
if [ $FILE_COUNT -gt 100 ] ; then
echo "File count is 100+, skipping pre-commit validation"
exit 0
fi
FAILED=0
@JohannesFischer
JohannesFischer / docker.sh
Last active November 7, 2017 00:50
Docker - Remove all untagged Images
docker image rm --force $(docker image ls | awk '$1 == "<none>" {print $3}')
@JohannesFischer
JohannesFischer / userscript.js
Created November 27, 2017 02:30
e-learning
console.log('E-Learning Boost Activated');
let initialized = false;
function getAnswerWindow() {
let win = window;
while (win.window.length > 0) {
win = win.window[1];
}
return win;