Skip to content

Instantly share code, notes, and snippets.

@arthuralvim
arthuralvim / Bibtex.sublime-build
Created June 1, 2012 15:13
Sublime Text 2 - build commands for bibtex and clean auxiliary files
// It's saved under path_to_Packages/User/
{
"cmd": ["bibtex", "$file_base_name"],
"path": "$PATH:/usr/texbin:/usr/local/bin",
"file_regex": "^(...*?):([0-9]+): ([0-9]*)([^\\.]+)",
"selector": "text.tex.latex"
}
@arthuralvim
arthuralvim / monthyearfield.py
Last active December 16, 2015 23:59 — forked from yashh/monthyearfield.py
A MonthYearWidget forked from yashh/monthyearfield.py .
from django import forms
import datetime
class MonthYearWidget(forms.MultiWidget):
"""
A widget that splits a date into Month/Year with selects.
"""
@arthuralvim
arthuralvim / setas.css
Created November 2, 2013 20:25
Arrows without images, only CSS. (Cross Browser) Setas sem usar imagem via CSS. (pt-br)
.seta{
width: 0;
height: 0;
}
.seta.cima {
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid #aaa;
}
@arthuralvim
arthuralvim / bootstrap.py
Created December 21, 2013 02:48
A virtualenv bootstrap script for a generic project in python.
# -*- coding: utf-8 -*-
import virtualenv, textwrap
output = virtualenv.create_bootstrap_script(textwrap.dedent("""
import os, subprocess
import urllib2
# YOUR REPO URL ex:
REPO = 'https://github.com/arthuralvim/dj-kickstart.git'
@arthuralvim
arthuralvim / megasena.py
Created December 31, 2013 14:12
Megasena Pythônica.
import random; random.sample(range(1,61),6)
@arthuralvim
arthuralvim / gen.py
Created January 3, 2014 18:49
Simple script to generate passwords.
import random
import string
def gen_pass(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
@arthuralvim
arthuralvim / saving_my_neck.ssh
Created January 12, 2014 20:10
I have accidentally deleted some .py untracked files. For my luck I found this project (https://github.com/wibiti/uncompyle2).
git clone [email protected]:wibiti/uncompyle2.git
cd uncompyle2/
python setup.py install
uncompyler2 thank_goodness_this_still_exists.pyc > recovered_file.py
@arthuralvim
arthuralvim / Vagrantfile
Last active August 29, 2015 13:58
Playing with Docker.
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
$script = <<-SCRIPT
apt-get update
locale-gen en_US en_US.UTF-8 pt_BR pt_BR.utf8 pt_PT.utf8
dpkg-reconfigure locales
apt-get install -y --force-yes curl git
@arthuralvim
arthuralvim / provyfile-2.py
Last active August 29, 2015 13:58
Examples of Provyfile.
#!/usr/bin/python
# -*- coding: utf-8 -*-
from provy.core import Role
from provy.more.debian import AptitudeRole
from provy.more.debian import NginxRole
from provy.more.debian import SupervisorRole
from provy.more.debian import TornadoRole
from provy.more.debian import UserRole
@arthuralvim
arthuralvim / breakpoint.less
Last active August 29, 2015 14:03
Bootstrap 3 Media Queries for Breakpoints.
// Custom Iphone screen (MIN)
@screen-iphone-min: 320px !default;
// Extra small screen / phone (MIN)
@screen-xs-min: 480px !default;
// Small screen / tablet (MIN)
@screen-sm-min: 768px !default;
// Medium screen / desktop (MIN)
@screen-md-min: 992px !default;
// Large screen / wide desktop (MIN)
@screen-lg-min: 1200px !default;