Skip to content

Instantly share code, notes, and snippets.

View b3z's full-sized avatar
🚿
showering

b3z

🚿
showering
  • 10:06 (UTC +02:00)
View GitHub Profile
@b3z
b3z / .gitignore
Last active September 1, 2022 17:29
My tex gitignore
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.soc
*.toc
@agzam
agzam / zathura-client.org
Last active March 10, 2025 11:13
Open pdf files with Zathura on Mac

Zathura on Mac

I want to open PDF files with Zathura on Mac. Problem is - Zathura does not have a proper App Bundle. So you cannot go in Finder to a pdf file, navigate to ‘Get Info’ and set pdf files to be opened with Zathura.

Luckily, you can create a custom App Bundle that wraps up a script that does that

But that is not as straightforward as you think it is, you can’t just execute a shell script. What if the file already opened with one of the instances of zathura process? Since Zathura is not a native OSX app, it will create a new process instance every time you open it.

The following script opens a file in Zathura, and if it was already opened, it would only activate the right window.

How to use it

@b3z
b3z / binding.md
Last active March 30, 2025 15:46
DDNet binding cheatsheet

Teewords config cheatsheet

In this repository you will find a collection of teeworlds binds, configs and scripts which you can use in your settings_ddnet.cfg

If you feel like a bind is missing please contribute.


How binding works

@b3z
b3z / pyny.py
Last active February 1, 2021 11:36
Tiny Python Webserver
#!/usr/bin/env python3
# A tiny webserver in python
# ready to run!
import os
import configparser
import socket
@seLain
seLain / openproject.conf
Last active April 25, 2025 19:45
nginx config for openproject
# assume :
# - openproject installed in /opt/openproject
# - local port: 6000
# - external port: 6020
server {
listen 6020;
server_name SERVER_DOMAIN_NAME;
root /opt/openproject/public;
@rambabusaravanan
rambabusaravanan / client.py
Created November 13, 2017 14:20
Simple TCP Streaming Server Client in Python
# Streaming Client
import socket
HOST = 'localhost'
PORT = 50007
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
while True:
@tasdikrahman
tasdikrahman / irssi.md
Last active April 24, 2025 18:53
irssi cheatsheet
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active April 27, 2025 09:56
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@joshnuss
joshnuss / app.js
Last active February 18, 2025 15:49
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@pascalpoitras
pascalpoitras / 1.md
Last active May 1, 2025 10:42
My WeeChat configuration

This configuration is not maintained anymore. You should think twice before using it, Breaking change and security issue will likely eventually happens as any abandonned project.