Skip to content

Instantly share code, notes, and snippets.

View LordMZTE's full-sized avatar
💭
Complaining about Python

LordMZTE

💭
Complaining about Python
View GitHub Profile
@LordMZTE
LordMZTE / ANSI.md
Last active January 6, 2022 07:03 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
use std::fs::File;
use std::path::Path;
/// opens a file from the resources folder
/// takes an `AsRef<Path>` for convenience. with this, a `&str` can be used
fn get_resource(path: impl AsRef<Path>) -> Option<File> {
let mut path_buf = std::env::current_exe().ok()?.parent()?.to_path_buf();
path_buf.push("resources");
path_buf.push(path);
File::open(path_buf).ok()
@LordMZTE
LordMZTE / README.md
Created September 13, 2020 15:09
Python

python is a pretty bad language because


  • weird syntax
    • I find it hard to read because its missing semicolons and braces
    • doc comments
      • they use triple quotes which doesn't make sense for a comment
      • they go under the item they are documenting which just looks ugly
    • lambdas are a poorly implemented afterthought
    • the def keyword is named inconsistently since "def" does in no way says that a function is being defined
  • indentation as a syntactical element is just silly. it takes freedom from the programmer and makes it harder to see where a block
@LordMZTE
LordMZTE / InstrClass.java
Last active June 20, 2020 14:15
Injecting Instrumented classes to classpath at runtime with javaassist
package de.mzte.test;
public class InstrClass {
public static void sayHello() {
System.out.println("Hello!");
}
}