An asynchronous MInecraft server votifier client in Python
Example Usage:
fromaiovotifierimportVotifierClientimportasyncioasyncdefmain():
client=VotifierClient("127.0.0.1", 8192, "testservicename", "token/rsa key")
# VotifierClient.vote(...) automatically determines the protocol and key formatawaitclient.vote("username", "user address")
awaitclient.vote("user2")
awaitclient.v1_vote("username", "user address") # only supports v1 protocolawaitclient.nu_vote("username", "user address") # only supports NuVotifier/v2 protocolasyncio.run(main())
Documentation
class aiovotifier.VotifierClient(host: str, port: int, service_name: str, secret: str)
Arguments:
host: str – The hostname or IP of the votifier server
port: int – The port of the votifier server, commonly 8192
service_name: str – The name of the service that sends the vote
secret: str – The public RSA key or the token found in config.yml
Methods:
vote(username: str, user_address: str = "127.0.0.1") – sends a vote to the votifier server, automatically detects and handles the protocol and type of secret
v1_vote(username: str, user_address: str = "127.0.0.1") – sends a Votifier v1 vote to a votifier v1 server
nu_vote(username: str, user_address: str = "127.0.0.1") -> dict – sends a NuVotifier / v2 vote to a NuVotifier server, returns the response from the server
class aiovotifier.VotifierHeader(header: bytes, version: str, token: str = None)
Arguments:
header: bytes – The header received from the votifier server
version: str – The version of the votifier server
challenge: str = None – The challenge, included only if the votifier server is v2/NuVotifier
Methods:
@classmethod parse(header: bytes) – Returns a new VotifierHeader, parsed from the input bytes
ReadMe HotSites
These are projects that had the objective of dissemination and creation to highlight an action of communication and timely marketing for sales of products services in the market. Real estate Loteamento Terras de San Francisco, Restaurants Oppadak, Lines of Biscoito Pelaggio.
Using: HTML5, CSS3, Sass, Grunt, Joomla Content Management System. With components: Jquery, Jquery Zoom.js, Media queries responsive.
Can be used with a local served xampp, mamp or of your preference. given start in Apache and MySQL. create a database of in admin, phpmyadmin by saofrancisco name.
In the configuration.php put the path of the folder and put the name of the bank
public $ db = 'saofrancisco';
public $ log_path = 'C:\\xampp\\htdocs\\lands-saofrancisco\\site / logs';
public $ tmp_path = 'C:\\xampp\\ htdocs\\lands-saofrancisco\\site / tmp';
ReadMe Portuquês
São projetos que teve o objetivo de divulgação e criação para destacar uma ação de comunicação e marketing pontual para vendas de produtos serviços no mercado.Imobiliario Loteamento Terras de São Francisco, Restaurantes Oppadak, Linhas de Biscoito Pelaggio .
Utilizando: HTML5, CSS3, Sass, Grunt,Sistema de Gerenciamento de Conteúdo Joomla. Com components: Jquery, Jquery Zoom.js, Media queries responsive.
Podendo ser ultilizado com um servido local xampp, mamp ou de sua preferencia. dado start no Apache e no MySQL . criar um banco de dados de no admin, phpmyadmin de nome saofrancisco.
No configuration.php colocar o caminho da pasta e colocar o nome do banco
public $db = 'saofrancisco';
public $log_path = 'C:\\xampp\\htdocs\\terras-saofrancisco\\site/logs';
public $tmp_path = 'C:\\xampp\\htdocs\\terras-saofrancisco\\site/tmp';
Define a temporary alias for interacting with the dotfiles repo:
alias dotfiles='git --git-dir="$HOME/.dotfiles.git/" --work-tree="$HOME"'
Attempt to checkout the files:
dotfiles checkout
Handle Conflicts: If the checkout command fails due to existing files you can perform one of two actions:
a) Backup existing files and replace (recommended):
# eg: backup the existing .config directory and git checkout
mv ~/.config ~/.config.bak
dotfiles checkout
Repeat the above for any other reported conflicting folders/files.
b) Overwrite existing files with force checkout:
dotfiles checkout -f
Configure the repository to ignore other untracked files in $HOME:
dotfiles config --local status.showUntrackedFiles no
This creates the following files in your $HOME directory:
# in $HOME
.config/**<-- configuration files
.dotfiles/ <-- template files for this repo
.dotfiles.git/ <-- .git dir for this repo
.gitconfig <-- core git config file
.gitconfig.proj <-- created from .dotfiles/*.template
README.md <-- this repo README
.zshenv <-- tell ZSH to look at ~/.config/zsh/*
Manual post-clone steps
Configure Git
Copy the template cp ~/.dotfiles/.gitconfig.project.template ~/.gitconfig.proj
Fill out the name and email properties in ~/.gitconfig.proj
If you do NOT wish to use SSH with Git then:
remove the gpg, commit, tag, and user sections from the file
If you wish to use SSH with Git then:
fill out the signingkey properties in ~/.gitconfig.proj
Create and Store an SSH key and use for Authentication/Commit-Signing in GitHub
I recommend using Fish over ZSH. ZSH configuration is here for convenience but I am considering dropping maintenance of it.
Fork and modify this repository instead of cloning it directly.
Files that may require modification are:
.zshenv
.config/brewfile/Brewfile*
Instead of using branching codepaths in your scripts for system-specific configurations you could use git branches to manage a copy for each system, with common/shared configuration in the master branch.
You would have to merge the common/shared configuration into the other branches on change.
Tools
I use Development Containers in most projects to manage project-specific dependencies. This keeps my OS installation relatively clean. Since devcontainers can mount your home directory, this repository contains some configuration files for tooling I commonly use within devcontainers that may not appear on my machine and therefore Brewfile.
The list of tools I use as a base on each system/OS are:
Use the following tools to change the shell on most Unix systems:
chsh -s $(which <DESIRED_SHELL>) $USER
sudo usermod --shell $(which <DESIRED_SHELL) $USER (when chsh is not available)
Git Conditional Configuration
I use the .gitconfig conditional includeIf directive to manage per-project Git settings in a separate configuration file to the ones committed to this repository (see the template in .dotfiles/.gitconfig.project.template directory for an example).
This is useful to manage different usernames, emails or authentication settings per project.
The includeIf directive allows for the following conditionals:
gitdir:<pattern>: Matches if the Git directory path matches the pattern, useful for applying settings to projects in specific locations (e.g., ~/work/).
onbranch:<branch-name-pattern>: Matches if the current branch name matches the pattern, useful for branch-specific workflows or settings.
hasconfig:remote.<name>.url:<pattern>: Matches if a remote’s URL matches the pattern, useful for loading different user configs for work vs. personal projects or different Git platforms.
As an example, this configuration applies the same config for remotes using GitHub via SSH & HTTPS, with another config for a singular organisation remote on BitBucket:
# git settings - GitHub SSH & HTTPS[includeIf "hasconfig:remote.*.url:https://github.com/**"]path = ~/.gitconfig.proj
[includeIf "hasconfig:remote.*.url:git@github.com:**"]path = ~/.gitconfig.proj
# git settings - project specific SSH# NOTE: ensure this does not overlap with any other includeIf conditions[includeIf "hasconfig:remote.*.url:git@bitbucket.org:<organisation_name>/**"]path = ~/<org_name>/.gitconfig.proj_<project_name>
This includes the specified configuration file if the repository you are running git commands against ( where the .git directory is) matches the provided pattern.
Creating your own git work-tree dotfiles repository
Here is a quick guide to creating your own bare repository for dotfiles using the $HOME as the git work-tree technique:
create a bare repository
set a temporary alias to use the bare repository (you should add this alias to your shell config as well for future use)
set the repo to ignore all untracked files (using our alias “dotfiles”)
set the remote origin to your GitHub (or other) repository
git init --bare $HOME/.dotfiles.git
alias dotfiles='git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
dotfiles remote add origin git@github.com:<username>/<repo>.git
Now add any of your existing .config files, track with git & push:
For more examples and inspiration see the HackerNews post where I learnt about this technique.
NB: The dotfiles alias is a temporary alias for the current shell session. I include it in my Fish & ZSH configuration files in this repository as a permanent way to quickly interact with my dotfiles repository.
NB: Even though all files are untracked thanks to the status.showUntrackedFiles no setting, I still recommend using .gitignore files when the configuration you wish to include is in a directory with other files you do not wish to include. This is purely a precautionary measure to avoid accidents. Though allow-listing files in .gitignore is a recommended practice.
Licence
Zero-Clause BSD
=============
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Lizard is a lightweight wrapper on top of Bun, a fast all-in-one JavaScript runtime. This project provides a simple and efficient way to create web applications with minimal setup.
Features
Fast and Lightweight: Built on Bun, ensuring high performance.
Simple Routing: Define routes easily with support for dynamic parameters.
Middleware Support: Add middleware functions to handle requests.
TypeScript Support: Written in TypeScript for type safety and better development experience.
utils.ts: Utility functions used by the framework.
utils.test.ts: Unit tests for utility functions.
Example Usage
Here is an example of how to define routes in your application:
importLizardfrom"./lizard";importtype{Middleware}from"./types";constapp=Lizard.create();// Global middleware to log requestsconstloggerMiddleware: Middleware=async(event,next)=>{console.log(`Request: ${event.method}${event.url}`);returnnext();};// Global middleware to add a custom headerconstheaderMiddleware: Middleware=async(event,next)=>{event.response.headers.set('X-Custom-Header','Lizard');returnnext();};// Apply global middlewaresapp.use(loggerMiddleware);app.use(headerMiddleware);app.get("https://github.com/",async(event)=>{returnevent.response.send("Hello, World!");});app.get('/home',async(event)=>{returnevent.response.send("Home Page");});app.get('/home/:id',async(event)=>{returnevent.response.send("Home Page"+event.params?.id);});app.get('/home/:id',async(event)=>{returnevent.response.send(`User ${event.params?.id}`);});app.get('/home/:id',async(event)=>{returnevent.response.send(`User ${event.params?.id}`);});app.get('/home/:id/profile',async(event)=>{returnevent.response.send(`User ${event.params?.id} Profile`);});app.post('/user',async(event)=>{returnevent.response.send("User Created");});app.put('/user/:id',async(event)=>{returnevent.response.send(`User ${event.params?.id} Updated`);});app.del('/user/:id',async(event)=>{returnevent.response.send(`User ${event.params?.id} Deleted`);});app.listen(3000);
In this example, the middleware sets a user object in the event.locals property. The /profile route then accesses this local variable and returns the user’s name in the response.