Skip to content

Instantly share code, notes, and snippets.

View LoryPack's full-sized avatar

Lorenzo Pacchiardi LoryPack

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@walterjwhite
walterjwhite / print-duplex.sh
Created April 10, 2020 16:54
bash - cups - lpr - print duplex
#!/bin/bash
# @see: https://opensource.com/article/20/4/print-duplex-bash-script#!/bin/bash
# take any PDF file and print the odd pages first
# THEN, ask the user to put the paper back in the printer, face down
# THEN, print even pages
# take the default printer from the cups configuration
# OR manually set it
@marcelroed
marcelroed / dbg.py
Last active September 29, 2021 14:23
Python print alternative inspired by Rust's dbg! macro
import inspect
import ast
def _args_from_usage_string_ast(s):
tree = ast.parse(s)
ast_args = tree.body[0].value.args
args = [s[arg.col_offset:arg.end_col_offset] for arg in ast_args]
return args