Skip to content

Instantly share code, notes, and snippets.

View roddds's full-sized avatar

Rodrigo Deodoro roddds

View GitHub Profile
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:
@roddds
roddds / manga.py
Last active August 29, 2015 14:04
#! /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)
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"
@roddds
roddds / admin.py
Created July 27, 2015 00:12
Showing foreign key attributes on Django Admin
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()
[run]
branch = True
omit = *migrations*,
*urls*,
*test*,
*admin*,
*scripts*,
*models*,
pipes/config/*,
pipes/manage.py,
@roddds
roddds / gist:a1f42bae598028ac7809
Last active December 8, 2020 22:46 — forked from raddevon/gist:67935d320ee9b726d19d
Adobe tries to strong-arm me into keeping Creative Cloud

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:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import time
import sys
import sched
from pync import Notifier
def main():
seconds = int(sys.argv[1]) * 60
text = sys.argv[2]
import subprocess
import asyncio
import os
import re
from collections import namedtuple
from bs4 import BeautifulSoup
import requests
'''
@roddds
roddds / remove_empty_dirs.py
Last active September 20, 2021 12:36
Recursively delete all empty directories
import os
for dirpath, dirnames, files in os.walk('.'):
if not (files or dirnames):
os.rmdir(dirpath)