Skip to content

Instantly share code, notes, and snippets.

View PatTheSilent's full-sized avatar
:octocat:

Patryk D. Cichy PatTheSilent

:octocat:
View GitHub Profile
#!/usr/bin/env bash
# This is a simple yet smart Minecraft autoclicker compatible with X Window Server
# (xdotool does not support Wayland at the time of writing this script)
# To use this autoclicker copy it to your workstation, make it executable and run it.
# Make sure to install https://github.com/jordansissel/xdotool#installation before using this script.
# Minecraft cannot be in fullscreen mode.
# You can put food in your off-hand, the script will hold right click for 4 seconds (enough to eat) every 15 minutes.
@PatTheSilent
PatTheSilent / envdefault.py
Created August 18, 2021 10:40
argparse action to get a default arg value from environment
# originally found in https://stackoverflow.com/a/10551190
import argparse
import os
class EnvDefault(argparse.Action):
def __init__(self, envvar, required=True, default=None, **kwargs):
if not default and envvar:
if envvar in os.environ:
default = os.environ[envvar]
# See blog post at http://vitobotta.com/sinatra-contact-form-jekyll/
%w(rubygems sinatra liquid active_support/secure_random resolv open-uri pony haml).each{ |g| require g }
APP_ROOT = File.join(File.dirname(__FILE__), '..')
set :root, APP_ROOT
set :views, File.join(APP_ROOT, "_layouts")
not_found do