Skip to content

Instantly share code, notes, and snippets.

View jkuchar's full-sized avatar

Jan Kuchař jkuchar

View GitHub Profile
@eneko
eneko / git-purge
Last active June 28, 2023 03:48
`git purge` command to delete local branches that have been deleted on remote
#!/usr/bin/env sh
set -e
echo "Pulling latest code..."
git pull
echo "Deleting local branches that were removed in remote..."
git fetch -p
git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
echo "Remaining local branches:"
git branch -vv
@tom--
tom-- / Random bytes, ints, UUIDs in PHP.md
Last active February 11, 2023 06:14
PHP random bytes, integers and UUIDs

Random bytes, ints, UUIDs in PHP

Simple and safe random getters to copy-paste

string randomBytes( int $length )

int randomInt ( int $min , int $max )

string randomUuid ( void )
@jameswebb68
jameswebb68 / gist:34ed19ed2b06d99c484b
Last active April 27, 2021 20:16
Synology Active Directory ADS join domain fix (suddenly nas lost connection to domain)
# Your NAS Synology device suddenly lost connection to your Windows Domain Controller, and or intermittent AD connectivity issues.
# Symptoms include but not limited to:
# - Failing to rejoin after removing the account on the Domain.
# - Failing to rejoin without any changes
# - Join attempt results in = "Failed to join the Windows domain. Please check your domain and firewall settings and try again"
# - Synology is joined, but attempting to connect from domain clients results in "There are no logon servers available to service the logon request"
# - This problem happens intermittently, sometimes rebooting the Synology device allows you to rejoin (Not a solution).
# - Sometimes rebooting both Synology device and Domain Controller allows you to rejoin (Not a solution).
# 1st.) *OPTIONAL* Remove the AD Synology device from Avtice Directory Users/Computers.
@hay
hay / gist:1351230
Last active March 29, 2024 16:36
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Enterprisify your Java Class Names! (by Hay Kranen)</title>
<style>
body {
background: white;
text-align: center;