Skip to content

Instantly share code, notes, and snippets.

Rodrigo Deodoro roddds

Block or report user

Report or block roddds

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@roddds
roddds / remove_empty_dirs.py
Last active Apr 28, 2019
Recursively delete all empty directories
View remove_empty_dirs.py
import os
for dirpath, dirnames, files in os.walk('.'):
if not (files or dirnames):
os.rmdir(dirpath)
View das_download.py
import subprocess
import asyncio
import os
import re
from collections import namedtuple
from bs4 import BeautifulSoup
import requests
'''
View reminder.py
import time
import sys
import sched
from pync import Notifier
def main():
seconds = int(sys.argv[1]) * 60
text = sys.argv[2]
View Timer decorator.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@roddds
roddds / gist:a1f42bae598028ac7809
Last active Nov 24, 2017 — forked from raddevon/gist:67935d320ee9b726d19d
Adobe tries to strong-arm me into keeping Creative Cloud
View gist:a1f42bae598028ac7809

To everyone who got here through Twitter or Facebook or Hacker News or whatever: THIS IS NOT ME.

The "Me" in this transcript is @raddevon, who shared his story first on reddit.


List of incompetent jackasses who can't check a source if their lives depended on it:

View gist:5cb26bd4c9fe7466b6eb
[run]
branch = True
omit = *migrations*,
*urls*,
*test*,
*admin*,
*scripts*,
*models*,
pipes/config/*,
pipes/manage.py,
@roddds
roddds / admin.py
Created Jul 27, 2015
Showing foreign key attributes on Django Admin
View admin.py
from django.contrib import admin
from django.core.urlresolvers import reverse
from .models import Carro, Fabrica, Pais
class CarroAdmin(admin.ModelAdmin):
list_display = ('nome', 'fabrica', 'pais')
def queryset(self):
qs = super(CarroAdmin, self).queryset()
View aliases.sh
alias runserver="python manage.py runserver_plus"
alias sp="python manage.py shell_plus"
alias manage="./manage.py"
alias syncdb="manage syncdb --migrate"
alias dif="git diff"
alias add="git add --all"
alias gs="git status"
alias commit="git commit -m"
alias gl="git log --graph --decorate --all"
View manga.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import urllib
from BeautifulSoup import BeautifulSoup as bs
def get_soup(link):
html = urllib.urlopen(link).read()
return bs(html)
View gist:7516735
def end_other(a, b):
a.lower()
b.lower()
if len(a) > len(b):
if a[len(b):] == b:
return True
return False
else:
if b[len(a):] == a:
You can’t perform that action at this time.