Skip to content

Instantly share code, notes, and snippets.

eval $(/usr/libexec/path_helper -s)
# bash
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
source $(brew --prefix)/etc/bash_completion
# git
GIT_PS1_SHOWDIRTYSTATE=true
@LuanP
LuanP / .vimrc
Created February 10, 2019 23:59
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
@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
)
import os
import time
def create_file():
with open('/tmp/arquivo', 'w') as f:
f.write('you just found level 3')
def remove_file():
@LuanP
LuanP / crawl.py
Last active August 29, 2015 14:27
simplificando web crawlers
# -*- coding: utf-8 -*-
import sys
import time
import urllib3
import urlparse
import requests
from bs4 import BeautifulSoup
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 = {
@LuanP
LuanP / export_tables
Created May 21, 2014 03:59
A script that exports tables from a MDB (Access database) file to SQL files
# 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.