Skip to content

Instantly share code, notes, and snippets.

@wayspurrchen
wayspurrchen / git patterns.md
Last active January 18, 2023 21:38
Useful Git Techniques

History

Show file at certain commit

git show <hash>:<file>

Show history of a file

git log -p <filename>

@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@frnhr
frnhr / .bash_profile
Created March 17, 2016 22:39
Show current pyenv python version in bash prompt, and also color virtual envs differently
####
#### pyenv-virtualenv bash prompt customization
####
# pyenv
eval "$(pyenv init -)"
# pyenv-virtualenv:
@MicBrain
MicBrain / metatags.html
Last active April 8, 2024 12:53
The list of useful meta tags used in HTML5 documents.
<html>
<head>
<!--Recommended Meta Tags-->
<meta charset="utf-8">
<meta name="language" content="english">
<meta http-equiv="content-type" content="text/html">
<meta name="author" content=”Rafayel Mkrtchyan”>
<meta name="designer" content=”Rafayel Mkrtchyan”>
<meta name="publisher" content=”Rafayel Mkrtchyan”>
@stephlocke
stephlocke / mora.R
Last active April 6, 2024 01:37
Additive or multiplicative time series?
if(!require("ggseas")) install.packages("ggseas")
if(!require("forecast")) install.packages("forecast")
if(!require("data.table")) install.packages("data.table")
if(!require("knitr")) install.packages("knitr")
library(ggseas)
library(forecast)
library(data.table)
# Get data

Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?

title = "TOML Example"

[owner]

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@h3
h3 / color.py
Last active June 27, 2019 19:38
Simple shell color outpout function
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import sys
def c(i):
"""
@michaelneu
michaelneu / README.md
Last active December 29, 2023 04:06
A basic, but fast git prompt.

bash-basic-git-prompt

This is a considerably faster, but much more basic alternative to bash-git-prompt.

When adding this script to your .bash_profile or .bashrc, it'll display the selected branch of the current folder (if it's a git repo), and whether it's modified (yellow) or contains staged files (cyan).

example

The script makes the assumption, that a .git folder only exists when the directory is a git repo. Also, it checks for the english version of the git status command, so if you're using git in a different locale, make sure to adjust this.