Skip to content

Instantly share code, notes, and snippets.

View roddds's full-sized avatar

Rodrigo Deodoro roddds

View GitHub Profile
@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 / imgur.py
Created July 12, 2012 17:42
imgurroulette
import urllib2
import random
import sys
ext = ['.png', '.jpg', '.gif']
chars = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
prefix = 'http://i.imgur.com/'
try:
print "Press Ctrl+C to end!"
@roddds
roddds / dash.py
Created November 4, 2012 13:22
Diamond Dash bot
'''
Diamond Dash bot
'''
import time
import autopy
import ImageGrab
from random import randint
from collections import Counter
import sys
import BeautifulSoup
import requests
def gethours(name):
if len(name) == 17 and name.isdigit:
xml = requests.get('http://steamcommunity.com/profiles/%s/games?xml=1' % name)
else:
xml = requests.get('http://steamcommunity.com/id/%s/games?xml=1' % name)
@roddds
roddds / Microsoft.PowerShell_profile.ps1
Created March 24, 2013 23:20
PowerShell profile for usage with git for windows and virtualenvwrapper
Set-ExecutionPolicy Unrestricted
import-module virtualenvwrapper
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\PoshGit_b45f39b7c5d40bebb0b5850a200fc120e9bf3646\profile.example.ps1")
num = []
maior = 0
for i in range(3):
num.append(int(raw_input("Numero %d: " % (i+1))))
if num[i] > maior:
maior = num[i]
print "\n Maior numero eh %d \n" % maior
if maior % 2 == 0:
@roddds
roddds / setup.sh
Last active December 20, 2015 12:39
sudo apt-get install build-essential python-pip ssh vim zsh git git-flow
sudo pip install virtualenvwrapper
export WORKON_HOME=~/Envs
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
function push {
echo "git push origin $(git rev-parse --symbolic-full-name --abbrev-ref HEAD)"
git push origin $(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
}
function pull {
echo "git pull origin $(git rev-parse --symbolic-full-name --abbrev-ref HEAD)"
git pull origin $(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
}
@roddds
roddds / .zshrc
Created September 25, 2013 19:19
useful git/django aliases
alias dif="git diff"
alias add="git add --all"
alias commit="git commit -m"
alias runserver="python manage.py runserver_plus"
alias sp="python manage.py shell_plus"
alias manage="./manage.py"
alias undo="git reset --soft HEAD^1"
alias unstage="git reset HEAD"