Skip to content

Instantly share code, notes, and snippets.

View walteranyika's full-sized avatar

elCoder walteranyika

View GitHub Profile
@walteranyika
walteranyika / gist:956d53fa60ed993d0b88bab9c01548ef
Created November 2, 2023 09:51 — forked from gameame/gist:1376105
Enforce unique upload file names in Django
def unique_filename(path):
"""
Enforce unique upload file names.
Usage:
class MyModel(models.Model):
file = ImageField(upload_to=unique_filename("path/to/upload/dir"))
"""
import os, base64, datetime
@walteranyika
walteranyika / JetbrainsEvaluationReset_2020.py
Created February 16, 2021 04:19 — forked from mreyesv/JetbrainsEvaluationReset_2020.py
[Activate] A Python Script To Reset The Evaluation License Of These Jetbrains Products Released In 2020 Or Later (IntelliJIdea, CLion, Rider, PyCharm, RubyMine, GoLand )
# Reset Jetbrains 2020 Products
import glob
import os
import winreg
from os import path
from os.path import expanduser
home = expanduser("~")
newJetbrainsHome = path.join(home, "AppData\Roaming\JetBrains")
@walteranyika
walteranyika / intellij-trial-reset.sh
Created April 1, 2020 16:45 — forked from beci/intellij-trial-reset.sh
reset intellij idea 14 - 2018.x.x evaluation
#!/bin/bash
# Thanks @ketos @krishjun @denis111
## declare array of tools
declare -a tools=(
"DataGrip"
"CLion"
"Rider"
"PhpStorm"