Skip to content

Instantly share code, notes, and snippets.

View mathebox's full-sized avatar
👋
Hi there!

Max Bothe mathebox

👋
Hi there!
View GitHub Profile
@mathebox
mathebox / InnerShadowView.swift
Last active August 29, 2018 08:01
UIView with inner shadow in Swift
import UIKit
class InnerShadowView: UIView {
lazy var innerShadowLayer: CAShapeLayer = {
let shadowLayer = CAShapeLayer()
shadowLayer.shadowColor = UIColor.black.cgColor
shadowLayer.shadowOffset = CGSize(width: 0.0, height: 0.0)
shadowLayer.shadowOpacity = 0.1
shadowLayer.shadowRadius = 14
@mathebox
mathebox / .gitconfig
Last active October 18, 2019 11:17
my global git config
[color]
ui = true
[fetch]
prune = true
[push]
default = simple
[diff]
noprefix = true
[alias]
unstage = reset HEAD --
@mathebox
mathebox / gh-labels.sh
Last active January 9, 2018 10:15
Script for setting up Github labels
#!/bin/bash
echo -n "GitHub username: "
read USER
echo -n "GitHub password or token: "
read -s PASS
echo ""
echo -n "GitHub Repo (e.g. foo/bar): "
@mathebox
mathebox / color_conversion.py
Created April 12, 2015 16:47
Python methods to convert colors between RGB, HSV and HSL
import math
def rgb_to_hsv(r, g, b):
r = float(r)
g = float(g)
b = float(b)
high = max(r, g, b)
low = min(r, g, b)
h, s, v = high, high, high
@mathebox
mathebox / custom-git-prompt.sh
Last active February 10, 2023 11:20
This is my custom git prompt for oh_my_zsh. It shows to current branch and the git dirty state (color). If a upstream exists, the difference is also displayed.
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=")$reset_color"
ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]"
ZSH_THEME_GIT_PROMPT_CLEAN=""
local oh_my_git_string="";
local has_upstream=false;