- Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
_(underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)0(zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
$(dollar) to move the cursor at the end of line (doesn't switch to insert mode)d$will delete from wherever your cursor is till the end of the linef<character>to move cursor to the first occurrence of<character>f(to move cursor to first occurence of(
t<character>to move cursor to upto but not on the first occurrence of<character>t(to move cursor to first occurence of(
| # syntax=docker/dockerfile:experimental | |
| FROM python:3.7-slim AS base | |
| # ENV LANG=C.UTF-8 # Sets utf-8 encoding for Python et al | |
| # ENV PYTHONDONTWRITEBYTECODE=1 # Turns off writing .pyc files; superfluous on an ephemeral container. | |
| # ENV PYTHONUNBUFFERED=1 # Seems to speed things up | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ |
git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.
| // For all the confusing Prometheus configuration and | |
| // regular expressions, | |
| // explained in examples. | |
| // Remember, there are default values for each item if it's missing. | |
| // regex is (.*), | |
| // replacement is $1, | |
| // separator is ; | |
| // ,and action is replace |
| #!/bin/bash | |
| clear | |
| # shameless taken from @g0tmilk kali os-scripts | |
| #### (Cosmetic) Colour output | |
| RED="\033[01;31m" # Issues/Errors | |
| GREEN="\033[01;32m" # Success | |
| YELLOW="\033[01;33m" # Warnings/Information | |
| BLUE="\033[01;34m" # Heading | |
| BOLD="\033[01;01m" # Highlight |
| <?php | |
| php artisan tinker | |
| $controller = app()->make('App\Http\Controllers\MyController'); | |
| app()->call([$controller, 'myMethodName'], []); | |
| //the last [] in the app()->call() can hold arguments such as [user_id] => 10 etc' |
| #!/usr/bin/env python | |
| """ | |
| mocking requests calls | |
| """ | |
| import mock | |
| import unittest | |
| import requests | |
| from requests.exceptions import HTTPError |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| " ---------------------- USABILITY CONFIGURATION ---------------------- | |
| " Basic and pretty much needed settings to provide a solid base for | |
| " source code editting | |
| " don't make vim compatible with vi | |
| set nocompatible | |
| " turn on syntax highlighting | |
| syntax on | |
| " and show line numbers |
These are my notes basically. At first i created this gist just as a reminder for myself. But feel free to use this for your project as a starting point. If you have questions you can find me on twitter @thomasf https://twitter.com/thomasf This is how i used it on a Debian Wheezy testing (https://www.debian.org/releases/testing/)
Discuss, ask questions, etc. here https://news.ycombinator.com/item?id=7445545