Skip to content

Instantly share code, notes, and snippets.

View djalmabright's full-sized avatar

Djalma Bina djalmabright

View GitHub Profile
@djalmabright
djalmabright / walmart.json
Created February 7, 2020 03:38 — forked from scrapehero/walmart.json
Sitemap to extract product data and pricing from Walmart using web scraper.io extension
{
"_id": "walmart",
"startUrl": [
"https://www.walmart.com/browse/home-improvement/electrical/1072864_1067619?povid=1072864+%7C+2018-05-02+%7C+Flyout_Electrical"
],
"selectors": [
{
"id": "product",
"type": "SelectorElementClick",
"parentSelectors": [
@djalmabright
djalmabright / client.cpp
Created November 27, 2018 22:26 — forked from SteveRuben/client.cpp
Multiple streaming in c++ using opencv; OpenCV video streaming over TCP/IP
/**
* OpenCV video streaming over TCP/IP
* Client: Receives video from server and display it
* by Steve Tuenkam
*/
#include "opencv2/opencv.hpp"
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
@djalmabright
djalmabright / capture.py
Created April 9, 2018 22:15 — forked from thearn/capture.py
Screen capture using python PIL
import time
import Image
import ImageGrab
while True:
time.sleep(0.5)
t = str(time.time()).replace('.','-')
tt = time.time()
img=ImageGrab.grab()
img = img.resize((800,600))
@djalmabright
djalmabright / django_admin_mpld3_view.py
Created March 28, 2018 20:35 — forked from leriomaggio/django_admin_mpld3_view.py
Interactive Matplotlib (Bar) Chart with mpld3 in Django Custom Admin View
#----------------------------------------------------------------------------------------
# model.py
#----------------------------------------------------------------------------------------
from django.db import models
from numpy.random import random_sample
class CustomModel(models.Model):
# Put your fields here
def get_data(self):
@djalmabright
djalmabright / pycon-views.py
Created March 24, 2018 20:29 — forked from miguelgrinberg/pycon-views.py
Generate statistics about PyCon 2014 videos
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'
pragma solidity ^0.4.18;
/**
* A contract that pays off, if a user is able to produce a valid solution
* for the Fermat's last theorem
*/
contract Fermat {
/**
from flask import Flask
from flask import request
node = Flask(__name__)
# Store the transactions that
# this node has in a list
this_nodes_transactions = []
@node.route('/txion', methods=['POST'])
def transaction():
@djalmabright
djalmabright / snakecoin-server-full-code.py
Created February 4, 2018 22:07 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
<?php
/**
* Coin Dashboard by Christian Haschek
* https://blog.haschek.at
*
* Donations always welcome
* BTC: 1ChrisHMgr4DvEVXzAv1vamkviZNLPS7yx
* ETH: 0x1337C2F18e54d72d696005d030B8eF168a4C0d95
*
* Read more at