This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval $(/usr/libexec/path_helper -s) | |
# bash | |
export CLICOLOR=1 | |
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx | |
source $(brew --prefix)/etc/bash_completion | |
# git | |
GIT_PS1_SHOWDIRTYSTATE=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@task | |
def bootstrap(): | |
"""Bootstrap machine to run fabric tasks""" | |
with settings(user=env.user): | |
bashrc = run('cat ~/.bashrc') | |
if 'DJANGO_SETTINGS_MODULE' not in bashrc: | |
default_settings = 'project_one.settings.{0}'.format( | |
env.environment | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
def create_file(): | |
with open('/tmp/arquivo', 'w') as f: | |
f.write('you just found level 3') | |
def remove_file(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import sys | |
import time | |
import urllib3 | |
import urlparse | |
import requests | |
from bs4 import BeautifulSoup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render, get_object_or_404 | |
from .models import Course | |
from .forms import ContactCourse | |
def index(request): | |
courses = Course.objects.all() | |
template_name = 'courses/index.html' | |
context = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script that exports tables from a MDB (Access database) file to SQL files | |
# Required: | |
# mdbtools (apt-get install mdbtools) | |
# a folder sql_tables in the script directory | |
### Usage | |
# create a folder in the current directory called sql_tables | |
# run this script like the following | |
# python export_tables.py ACCESS_DATABASE.MDB table1,table2,"My Table 3",other_table | |
# Done. |