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
#!/bin/bash | |
# Save this file as /usr/bin/apt-pac and chmod +x it. | |
case "$1" in | |
autoremove) | |
pacman -Rns $(pacman -Qdtq); | |
;; |
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
arq = open('alice.txt') | |
texto = arq.read() | |
texto = texto.lower() | |
import string | |
for c in string.punctuation: | |
texto = texto.replace(c, ' ') | |
texto = texto.split() | |
dic = {} | |
for p in texto: |
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
"""Library to access del.icio.us data via Python. | |
:examples: | |
Using the API class directly: | |
>>> a = pydelicious.apiNew('user', 'passwd') | |
>>> # or: | |
>>> a = DeliciousAPI('user', 'passwd') | |
>>> a.tags_get() # Same as: |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
" http://vimcasts.org/episodes/writing-a-custom-fold-expression/ | |
function! MarkdownFolds() | |
let thisline = getline(v:lnum) | |
if match(thisline, '^##') >= 0 | |
return ">2" | |
elseif match(thisline, '^#') >= 0 | |
return ">1" | |
else | |
return "=" | |
endif |
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 sys | |
import os | |
import hashlib | |
# source: http://stackoverflow.com/questions/748675/finding-duplicate-files-and-removing-them | |
# This version uses the file size and a hash of the contents to find duplicates. You can pass | |
# it multiple paths, it will scan all paths recursively and report all duplicates found. | |
def chunk_reader(fobj, chunk_size=1024): | |
"""Generator that reads a file in chunks of bytes""" |
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 requests | |
URL = "http://thenounproject.com/download/zipped/svg_%s.zip" | |
HUMAN_URL = "http://thenounproject.com/modal/%s/" | |
def main(): | |
index = 0 | |
errors = [] |
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
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
# Arquivo: keylogger para linux | |
# Criado: Qua 04/Mai/2011 hs 14:01 | |
# Last Change: 2011 Mai 04 14:30:42 | |
# autor: bavardage (Ben Duffield) | |
# site: http://ardoris.wordpress.com | |
# changed by: Sérgio Luiz Araújo Silva | |
# reference: http://blog.liquuid.net/2011/04/23/como-fazer-um-keyloggermouse-no-linux/ |
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
# source: http://stackoverflow.com/questions/517970/how-to-clear-python-interpreter-console | |
import os | |
def cls(): | |
os.system(['clear','cls'][os.name == 'nt']) | |
# now, to clear the screen | |
cls() |