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
/** | |
* Bookmarklet que exporta os dados de uma tabela em CSV | |
* | |
* Para evitar poluir no namespace rodamos o script numa função anônima | |
*/ | |
(function(){ | |
//Verifica a existência do jQuery | |
if (typeof jQuery == 'undefined') { | |
var jQ = document.createElement('script');//Cria um novo elemento do tipo script | |
jQ.type = 'text/javascript';//Define o tipo desse elemento para text/javascript |
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/python | |
#-------------------------------------- | |
# ___ ___ _ ____ | |
# / _ \/ _ \(_) __/__ __ __ | |
# / , _/ ___/ /\ \/ _ \/ // / | |
# /_/|_/_/ /_/___/ .__/\_, / | |
# /_/ /___/ | |
# | |
# lcd_16x2.py | |
# 16x2 LCD Test Script |
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 socket | |
def haveInternet(): | |
REMOTE_SERVER = "www.google.com" | |
try: | |
host = socket.gethostbyname(REMOTE_SERVER) | |
s = socket.create_connection((host, 443)) | |
return True | |
except: |
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 -*- | |
import netifaces | |
def get_if_ipaddr(iface): | |
""" | |
Retorna o IP de uma interface de rede | |
Args: |
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 | |
# Envia o resultado de um comando para um tailbox `dialog` | |
# Parametros: | |
# $1 - titulo | |
# $2 - comando | |
pipe_command_to_tailbox_dialog() { | |
# Extraindo os parametros,sempre usando $1 seguido de `shift` | |
local title="$1"; shift |
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 | |
sudo apt-get install --no-install-recommends xserver-xorg xinit xserver-xorg-video-fbdev lxde lxde-common lightdm | |
sudo apt-get install git build-essential xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev | |
git clone https://github.com/ssvb/xf86-video-fbturbo.git | |
cd xf86-video-fbturbo | |
autoreconf -vi | |
./configure --prefix=/usr |
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
javascript:window.open('data:text/plain;base64,'+btoa(angular.element(document.querySelector('.md-tab-content:not(.ng-hide) .charge')).scope().$parent.$parent.charges.map(c => `${c.post_date.split('-').reverse().join('/')};${c.title};${c.category};${(c.amount/100).toFixed(2).replace('.', ',')}`).join('\n'))) |
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 requests | |
from collections import Counter, defaultdict | |
class TextSearch: | |
def __init__(self, url): | |
self.url = url | |
self.word_list = [str(v).lower() for v in self.get_text().split()] | |
self.word_lenght = len(self.word_list) | |
self.word_count = Counter(self.word_list) | |
self.count_word = defaultdict(list) |
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
# rodrigo.deodoro@esharesinc.com | |
def validate_matrix(matrix): | |
# Valida linhas | |
if not all(list_int(i) for i in matrix): | |
return False | |
# Valida colunas | |
columns = [] |
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
(function (doc) { | |
function getForm() { | |
return doc.querySelector('#formQuestao'); | |
} | |
function getQuestionId() { | |
const form = getForm(); | |
return parseInt(form.querySelector('input[name="questao_id"]').value, 10); | |
} |
OlderNewer