Skip to content

Instantly share code, notes, and snippets.

View meistermeier's full-sized avatar
🥰

Gerrit Meier meistermeier

🥰
View GitHub Profile
@meistermeier
meistermeier / proxy.ps1
Created August 28, 2024 07:38
Changing the proxy in Windows via PowerShell script. I ran through the pain so you don't have to. Could it be nicer? For sure! Do I want to spend more time on this than needed? Hell no!
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$server = "<your_host>"
$port = "<your_port>"
# Set the proxy without any check (for configuring it before entering the network)
function Set-Proxy-No-Check {
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyServer -Value "$($server):$($port)"
Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyEnable -Value 1
@meistermeier
meistermeier / iphone_hotspot.sh
Last active April 30, 2024 14:53
iphone hotspot config
#!/usr/bin/env bash
if [[ -z $1 || $1 == "off" ]]; then
echo "Resetting Wi-Fi to DHCP"
networksetup -setdhcp Wi-Fi
exit 0
fi
if [[ $1 == "on" ]]; then
echo "Setting manual ip address"
@meistermeier
meistermeier / AsciidoctorCypher.java
Created January 28, 2022 10:55
Cypher execution from Asciidoctor document with AsciidoctorJ
import org.asciidoctor.Asciidoctor;
import org.asciidoctor.Options;
import org.asciidoctor.ast.Block;
import org.asciidoctor.ast.StructuralNode;
import org.neo4j.driver.Driver;
import java.net.URISyntaxException;
import java.nio.file.Path;
public class AsciidoctorCypher {
curl -s "https://calendar.spring.io/releases?start=$(date --iso-8601)&end=$(date --iso-8601 --date='next month')" | jq '.[] | [.start, .title] | @csv' | sed 's/[\\"|"]//g' | column -s ',' -t | sort | less

Keybase proof

I hereby claim:

  • I am meistermeier on github.
  • I am meistermeier (https://keybase.io/meistermeier) on keybase.
  • I have a public key ASDKLUqxF6Pguqw9-eaxq8eEMeZRfwiKYzvRQlhL6h6M0Qo

To claim this, I am signing this object:

@meistermeier
meistermeier / mvnwhy.sh
Last active February 21, 2017 08:20
mvn dependency tree filtered
# uses mvn dependency plugin to show why a certain dependency or dependencies are used
function mvnwhy() {
CANDIDATES=(`mvn dependency:list | grep $1 | awk '{print $2}'`)
for CANDIDATE in ${CANDIDATES[@]}; do
echo "Why $CANDIDATE?"
declare -a CANDIDATE_SEGMENTS
CANDIDATE_SEGMENTS=(`echo $CANDIDATE | awk 'BEGIN{FS=":"}{for (i=1; i<=2; i++) print $i}'`)
# this just works in zsh for bash use: DEPENDENCY=${CANDIDATE_SEGMENTS[0]}:${CANDIDATE_SEGMENTS[1]}
@meistermeier
meistermeier / git-helper
Last active September 28, 2020 13:32
Git helper
List merged remote branches:
git branch -r --merged origin/master | grep -v HEAD | grep -v master
Delete merged remote branches:
for branch in `git branch -r --merged origin/master | grep -v HEAD | grep -v master`; do git branch -r -d $branch; git push origin --delete ${branch#origin/}; done
Branch delete game:
for branch in `git branch -r | grep -v HEAD | grep -v master`; do echo "Should I delete $branch? (y)"; read CHOICE; if [ "$CHOICE" = "y" ]; then git branch -r -d $branch; git push origin --delete ${branch#origin/} ; fi; done
List tags by pattern
import com.netflix.hystrix.HystrixThreadPoolKey;
import com.netflix.hystrix.strategy.concurrency.HystrixConcurrencyStrategy;
import com.netflix.hystrix.strategy.properties.HystrixProperty;
import commonj.work.Work;
import commonj.work.WorkManager;
import javax.naming.InitialContext;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
@meistermeier
meistermeier / video.html
Last active August 29, 2015 14:10
simple in browser webcam capturing
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Simple Video Capture</title>
<style type="text/css">
#videoElement {
width: 70%;
}
</style>
@meistermeier
meistermeier / weather.js
Created April 11, 2014 12:57
Yahoo weather codes to erikflowers/weather-icons
var code2Icon = function(code) {
code = parseInt(code);
switch (code) {
case 0: return 'wi-tornado';
case 1: return 'wi-tornado';
case 2: return 'wi-tornado';
case 3: return 'wi-thunderstorm';
case 4: return 'wi-thunderstorm';
case 5: return 'wi-rain-mix';
case 6: return 'wi-rain-mix';