Skip to content

Instantly share code, notes, and snippets.

View etenzy's full-sized avatar

Michael Rödel etenzy

View GitHub Profile
@etenzy
etenzy / values_pointers.go
Created April 22, 2020 19:27 — forked from josephspurrier/values_pointers.go
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@etenzy
etenzy / .bash_aliases
Created April 19, 2020 22:30 — forked from hikiko4ern/.bash_aliases
Pikachu test passed (demo: https://asciinema.org/a/236096)
# /------------------------------------------\
# | don't forget to download the .tp file |
# | and place it in the user's directory :› |
# | |
# | also install lolcat: |
# | https://github.com/busyloop/lolcat |
# \------------------------------------------/
alias test-passed='if [ "$?" -eq "0" ]; then lolcat ~/.tp -a -s 40 -d 2; fi;'

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package:

@etenzy
etenzy / touchid_sudo.sh
Created April 12, 2020 16:29 — forked from RichardBronosky/touchid_sudo.sh
Use TouchID for sudo on modern MacBook Pro machines
#!/bin/bash
# curl -sL https://gist.githubusercontent.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70/raw/touchid_sudo.sh | bash
# This script is ready to copy-paste in whole, or just the line above (without the leading #)
# Use TouchID for sudo on modern MacBook Pro machines
# This script adds a single line to the top of the PAM configuration for sudo
# See: https://apple.stackexchange.com/q/259093/41827 for more info.
touchid_sudo(){
@etenzy
etenzy / ssh-proxy-current.scpt
Last active July 20, 2020 08:42
Automatically step thru ssh proxies
#!/usr/bin/osascript
on trim(theseCharacters, someText)
if class of someText is text and length of someText > 0 then
-- default values (all whitespace)
if theseCharacters is true then ¬
set theseCharacters to {" ", tab, ASCII character 10, return, ASCII character 0}
repeat until first character of someText is not in theseCharacters
set someText to text 2 thru -1 of someText
#!/usr/bin/python2
# setup: pip install requests lxml beautifulsoup4
from decimal import Decimal
import requests
from bs4 import BeautifulSoup
import sys
# Session setup
@etenzy
etenzy / cropdetect.sh
Last active October 9, 2019 15:42
ffmpeg tools
#!/bin/bash
# [Parsed_cropdetect_0 @ 0x220cdc0] x1:0 x2:1279 y1:0 y2:719 w:1280 h:720 x:0 y:0 pts:215 t:0.215000 crop=1280:720:0:0
# [Parsed_cropdetect_0 @ 0x220cdc0] x1:0 x2:1279 y1:0 y2:719 w:1280 h:720 x:0 y:0 pts:257 t:0.257000 crop=1280:720:0:0
# [Parsed_cropdetect_0 @ 0x220cdc0] x1:0 x2:1279 y1:0 y2:719 w:1280 h:720 x:0 y:0 pts:299 t:0.299000 crop=1280:720:0:0
ffmpeg -ss 90 -i $1 -vframes 10 -vf cropdetect -f null -
@etenzy
etenzy / friday-deploy.sh
Last active July 8, 2019 09:23
Don't deploy on friday
#!/bin/bash
if [[ $(date +%u) -eq 5 ]]; then
case $[ $RANDOM % 8] in
0)
echo '
___________ .__ .___ .___ .__
\_ _____/______|__| __| _/____ ___.__. __| _/____ ______ | | ____ ___.__.
| __) \_ __ \ |/ __ |\__ \< | | / __ |/ __ \\____ \| | / _ < | |
SPACESHIP_USER_PREFIX=""
SPACESHIP_CHAR_SYMBOL="λ"
SPACESHIP_CHAR_SYMBOL_ROOT="#"
SPACESHIP_CHAR_SYMBOL_SECONDARY="➜"
SPACESHIP_CHAR_SUFFIX=" "
SPACESHIP_CHAR_COLOR_SUCCESS="white"
SPACESHIP_TIME_SHOW="true"
#include <iostream>
#include <vector>
#include <cstdlib>
namespace 🔵 = std;
using 🔢 = int;
using 💀 = void;
using 🕖 = time_t;
using 👌 = bool;
#define 👂 auto