Skip to content

Instantly share code, notes, and snippets.

View Liam-Nothing's full-sized avatar
🌟
Working

Liam Liam-Nothing

🌟
Working
View GitHub Profile
pip freeze | % {pip uninstall -y $_.split('==')[0]}
@Liam-Nothing
Liam-Nothing / sort_by_lenght.cmd
Created September 10, 2023 22:21
One-liner command in the shell to sort each line of a file by length.
python -c "lines = open('_top_level_domains.txt').readlines(); lines.sort(key=len); open('output.txt', 'w').writelines(lines)"
@Liam-Nothing
Liam-Nothing / view_error.php
Created December 23, 2022 19:42
Enable error message in PHP
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
@Liam-Nothing
Liam-Nothing / reverse_lines.py
Created August 17, 2022 20:36
Reverse lines in text file
f = open("text.txt", "r")
s = f.read()
s = s.split("\n")
s.reverse()
s = "\n".join(s)
f.close()
f = open("reverse_text.txt", "w")
f.write(s)
f.close()