Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Richard Fussenegger Fleshgrinder

🎯
Focusing
Block or report user

Report or block Fleshgrinder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Fleshgrinder
Fleshgrinder / jenv
Last active Jun 19, 2019
How to install jEnv on a Mac with Maven and Gradle wrapper support.
View jenv
#!/usr/bin/env bash
set -Eeuo pipefail
brew install gradle jenv mvn
mkdir -p ~/bin
curl -Lo ~/bin/gradle 'https://gist.githubusercontent.com/Fleshgrinder/b4411e49fb97f000d57b65755d49740c/raw/gradle'
chmod +x ~/bin/gradle
@Fleshgrinder
Fleshgrinder / install
Last active Jun 22, 2019
Script to execute Maven wrapper with jEnv and fallback to global Maven installation.
View install
#!/usr/bin/env bash
set -Eeuo pipefail
mkdir -p ~/bin
curl -Lo ~/bin/mvn 'https://gist.githubusercontent.com/Fleshgrinder/4dea4a703e850fed44b6a6fe47876237/raw/mvn'
chmod +x ~/bin/mvn
View keybase.md

Keybase proof

I hereby claim:

  • I am Fleshgrinder on github.
  • I am fleshgrinder (https://keybase.io/fleshgrinder) on keybase.
  • I have a public key whose fingerprint is 07DC 4CF5 EF0B 27D9 A311 9EA5 A5A2 6F7B 85A4 A347

To claim this, I am signing this object:

View git-clean-branches
#!/usr/bin/env bash
set -eu
# http://docopt.org/
usage() {
cat << EOT
Clean local branches except for master.
Usage: git-clean-branches [options...]
@Fleshgrinder
Fleshgrinder / windows-setup.ps1
Last active Sep 10, 2018
A few commands I routinely execute after setting up a new Windows machine to speed thing up a little and disable annoying stuff.
View windows-setup.ps1
function dword {
Param([string] $path, [string] $name, [string] $value)
if (!(Test-Path $path)) {
New-Item -Path (Split-Path $path) -Name (Split-Path $path -leaf) | Out-Null
}
New-ItemProperty -Path $path -Name $name -Value $value -PropertyType DWORD -Force | Out-Null
}
# disables the creation of so called 8dot3names
fsutil 8dot3name set 1 | Out-Null
@Fleshgrinder
Fleshgrinder / gradle
Last active Jun 22, 2019
Global script to resolve to the closest available Gradle Wrapper script.
View gradle
#!/usr/bin/env bash
set -Eeuo pipefail
if command -v jenv &>/dev/null; then
JAVA_HOME=$(jenv javahome)
export JAVA_HOME
fi
if [[ -f gradlew ]]; then
./gradlew "$@"
@Fleshgrinder
Fleshgrinder / pull-request-url.sh
Created Jun 19, 2018
Show GitHub link for PR creation after pushing to remote. Store this in `.git/hooks/pre-push` and make it executable.
View pull-request-url.sh
#!/bin/sh
cat << EOF
Create PR at: https://github.com/$(git remote get-url origin | grep -Eo '[^/:]+/[^/.]+')/compare/$(git rev-parse --abbrev-ref HEAD)?expand=1
EOF
@Fleshgrinder
Fleshgrinder / gpg.sh
Created May 1, 2017
Create GPG Key for GitHub Commit Signing
View gpg.sh
#!/bin/sh
#
# Commands for generating a new GPG key for GitHub commit signing.
#
# https://help.github.com/articles/generating-a-new-gpg-key/
#
gpg --gen-key
# 1. 1
@Fleshgrinder
Fleshgrinder / Nullsafe.ceylon
Created Feb 19, 2017
The Case of the Null Reference: Code Listing 4
View Nullsafe.ceylon
function f(Integer? x) {
return x?.plus(42);
}
print(f(null));
@Fleshgrinder
Fleshgrinder / Referecnes.php
Created Feb 19, 2017
The Case of the Null Reference: Code Listing 3
View Referecnes.php
<?php
class NaturalNumber {
private $n;
public function __construct(int &$n) {
if ($n < 1) {
throw new InvalidArgumentException('n must be greater than zero, got ' . $n);
}
You can’t perform that action at this time.