Skip to content

Instantly share code, notes, and snippets.

View airstrike's full-sized avatar
🎯
Focusing

Andy airstrike

🎯
Focusing
View GitHub Profile
@ihercowitz
ihercowitz / VisaVale.py
Created October 28, 2010 13:19
Script para obter o saldo do Visa Vale
import urllib2, urllib, sys
from BeautifulSoup import BeautifulSoup
import re
class VisaVale():
def get_visavale_informations(self,visa):
url = 'http://www.cbss.com.br/inst/convivencia/SaldoExtrato.jsp'
data = urllib.urlencode([('numeroCartao',visa),('primeiroAcesso','S')])
request = urllib2.Request(url)
@RichardBronosky
RichardBronosky / userprofiles.admin.py
Created May 10, 2011 14:54
Django admin field order by m2m (or FK) relationship
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from userprofiles.models import UserProfile
class UserProfileInline(admin.StackedInline):
model = UserProfile
fk_name = 'user'
max_num = 1
@airstrike
airstrike / vimrc
Created January 12, 2012 12:32
my vimrc file
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" a lot of this was stolen from: http://amix.dk/vim/vimrc.html "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set 7 lines to the curors - when moving vertical..
set so=2
set wildmenu "Turn on WiLd menu
@jaddison
jaddison / gist:1943426
Created February 29, 2012 18:43
adding to the templates tags available by default - add to the top of settings.py for example
from django.template.loader import add_to_builtins
add_to_builtins('django.contrib.staticfiles.templatetags.staticfiles')
add_to_builtins('django.templatetags.i18n')
add_to_builtins('django.templatetags.future')
@airstrike
airstrike / github.vim
Created May 22, 2012 18:00
Github-like color theme for vim. It's based on http://www.vim.org/scripts/script.php?script_id=2855 with fixes for .py files.
" Vim color file
"
" Author: André Terra <andreterra+nospam@gmail.com>
"
" Note: Anthony Carapetis original version of github's syntax thmee
" with a few changes, like better .py highlighting and line #s.
" Used Brian Mock's darkspectrum as a starting point/template
" Thanks to Ryan Heath for an easy list of some of the colours:
" http://rpheath.com/posts/356-github-theme-for-syntax-gem
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 22, 2024 17:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@slig
slig / admonition.py
Created August 27, 2012 11:35
admonitions extension for python-markdown
import re
import markdown
from markdown.util import etree
class AdmonitionExtension(markdown.Extension):
def extendMarkdown(self, md, md_globals):
md.registerExtension(self)
@seamusabshere
seamusabshere / excelwebservice.vb
Created September 28, 2012 15:44
Excel VB for accessing http://carbon.brighterplanet.com/flights.txt as a web service (early 2011)
Option Explicit
Function GetBrighterPlanetApiKey()
GetBrighterPlanetApiKey = ActiveWorkbook.Worksheets("Setup").Range("C2").Value
End Function
Function IsEmissionEstimateServiceOnline()
If LCase(ActiveWorkbook.Worksheets("Setup").Range("C3").Value) = "online" And ThisWorkbook.HasFinishedWorkbookOpen() = True Then
IsEmissionEstimateServiceOnline = True
Else
anonymous
anonymous / AppleWKHelper.ahk
Created December 15, 2012 12:28
AutoHotkey script from Billy TK Functions..: Make Apple Wireless Keyboard useful in MS Windows: - EJECT = Delete with repeat deleting on long pressing. Shift-DEL and other combinations works too. - Swap FN & left Control - FN-functions оn F3-F12 keys and arrow keys (use new-FN) - FN+EJECT = drive eject - F12 = INSERT (on your need, it simple to …
;
; AutoHotkey Version: 1.x
; Language.........: English
; Platform.........: NT/XP/Vista
; Author...........: mrBTK
;
; Script Function..: Make Apple Wireless Keyboard useful in MS Windows:
; - EJECT = Delete with repeat deleting on long pressing. Shift-DEL and other combinations works too.
; - Swap FN & left Control
; - FN-functions оn F3-F12 keys and arrow keys (use new-FN)
@vsajip
vsajip / pyvenvex.py
Last active July 13, 2024 00:34
A script which demonstrates how to extend Python 3.3's EnvBuilder, by installing setuptools and pip in created venvs. This functionality is not provided as an integral part of Python 3.3 because, while setuptools and pip are very popular, they are third-party packages.The script needs Python 3.3 or later; invoke it using"python pyvenvex.py -h"fo…
#
# Copyright (C) 2013-2020 Vinay Sajip. New BSD License.
#
import os
import os.path
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve