Skip to content

Instantly share code, notes, and snippets.

View Preocts's full-sized avatar
💜
New code, who dis?

Preocts Preocts

💜
New code, who dis?
View GitHub Profile
@Jip-Hop
Jip-Hop / README.md
Last active June 29, 2024 14:43
Simple comment preserving ConfigParser class to read/update/write INI files WITHOUT indented sections/keys/comments.

See the example usage inside configparser.py. Output when running the configparser.py file:

# Comments may appear before the first section

[Simple Values]
key = value
spaces in keys = allowed
spaces in values = allowed as well
spaces around the delimiter = obviously
@loopyd
loopyd / deienv.py
Last active January 10, 2024 03:22
[py] Pydantic environment (.env) file parser
from pydantic import BaseModel, Field
from typing import Any, Callable, Type, TypeVar, Union
import os, sys
class EnvFileModel(BaseModel):
class Config:
validate_assignment = True
extra = "forbid"
arbitrary_types_allowed = True
@n0Oo0Oo0b
n0Oo0Oo0b / pip-python-mismatch.md
Last active April 6, 2023 04:00
How to fix pip not installing packages even though it says 'requirement already satisfied'

Problem

Let's say you wanted to install a package (numpy for example) and you run the following command to install it:

$ pip install numpy

So pip does its thing, and exits with an output like so:

// ==UserScript==
// @name @chaoticvibing Twitter Blue Nerd - twitter.com
// @namespace Violentmonkey Scripts
// @match *://*.twitter.com/*
// @match *://*.x.com/*
// @grant none
// @version 1.9.2
// @author @chaoticvibing - GH @busybox11
// @description 11/9/2022, 11:45:28 PM
// @updateURL https://gist.githubusercontent.com/busybox11/53c76f57a577a47a19fab649a76f18e3/raw
@CoolGuyBraydan
CoolGuyBraydan / Zombie Survival.py
Last active April 9, 2024 20:30
Zombie Survival Python (Hope you enjoy)
import turtle
import time
import random
import math
print('"Zombie Survival (3.2)" made by Braydan Smith')
print()
print("Would you like a tutorial? Enter 'yes' or 'no' (and DO NOTHING ELSE!).")
awnser=input(":")
awnser=awnser.lower()
#!/bin/bash
#
# Create a throwaway Python project
# Usage:
#
# 1. Put the script as `pysandbox` somewhere on your PATH
# 2.
# if (you want a predefined project name):
# source pysandbox play-around-with-aioredis
# elif (you want a random one):
@ursulacj
ursulacj / Create-branch-with-Github-API.md
Last active June 26, 2024 17:23 — forked from auwsome/Create-branch-with-Github-API.md
Create a branch on Github using API and Python

Create a branch on Github using API and Python

Created as a module that can be imported or run. Requires built in JSON, requests, and datetime modules.

Allows you to clone a branch on Github using the Github Git Database API Endpoints.

Forked Gist from:

  • auwsome/Create-branch-with-Github-API.md

See:

// code updates are now there:
// https://github.com/Bleuje/processing-animations-code/blob/main/code/radialcollapse/radialcollapse.pde
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab is be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
// See the license information at the end of this file.
// View the rendered result at: https://bleuje.com/gifanimationsite/single/radialcollapse/
@lumengxi
lumengxi / Makefile
Created March 17, 2016 16:44
Makefile for Python projects
.PHONY: clean-pyc clean-build docs clean
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef