Skip to content

Instantly share code, notes, and snippets.

View davidalves1's full-sized avatar

David Alves de Souza davidalves1

View GitHub Profile

Minerar HTMLCoin

Para minerar é necessário baixar a última versão da carteira para o seu SO e abrir o console em Help > Debug Window > Console

O comando utilizado para minerar é generatetoaddress 10000 HZ1BNT1guxuSqniAeYkUhP1kwmHVEdXFff 99999999, onde:

  • generatetoaddress: é o comando da carteira para minerar
  • 10000: quantidade de blocos para tentar minerar. Você pode substituir pelo número que quiser. Coloquei 10000 pois achei um valor razoável
  • HZ1BNT1guxuSqniAeYkUhP1kwmHVEdXFff: endereço de destino caso algum bloco seja encontrado. Você DEVE CRIAR um endereço de recebimento na opção Recive na sua carteira e DEVE SUBSTITUIR esse endereço pelo seu, senão suas moedinhas virão para mim (o que eu não acho nada ruim.. hehehe)
  • 99999999: número de tentativas para quebrar cada bloco
@davidalves1
davidalves1 / my-site
Last active June 28, 2018 01:25
Resolving the problem of the 404 error of Laravel with Nginx on Ubuntu Linux
server {
listen 80;
# listen [::]:80;
root /home/user/projects/my-site/public;
index index.php index.html index.htm;
server_name my-site.local;
location / {
# try_files $uri $uri/ /index.php?$query_string =404; <---------- WRONG
@davidalves1
davidalves1 / Raspa_salarios_UFRJ.py
Created October 26, 2017 00:01 — forked from fmasanori/Raspa_salarios_UFRJ.py
Raspa 15 mil vencimentos da UFRJ e mostra os maiores
import requests
from bs4 import BeautifulSoup as bs
u = 'http://www.portaldatransparencia.gov.br/servidores/OrgaoLotacao-ListaServidores.asp?CodOS=15000&DescOS=MINISTERIO%20DA%20EDUCACAO&CodOrg=26245&DescOrg=UNIVERSIDADE%20FEDERAL%20DO%20RIO%20DE%20JANEIRO&Pagina='
base = 'http://www.portaldatransparencia.gov.br/'
def extrai_valor(u):
j = u.find('=') + 1
k = u.find('&', j)
id_servidor = u[j: k]
@davidalves1
davidalves1 / index.php
Last active June 18, 2017 13:29
Teste leitor XML
<?php
class LeitorXml
{
protected $path;
public function __construct($path)
{
$this->path = $path;
# -*- coding: utf-8 -*-
import json
res = '{"nome": "Vívian Beça Magalhães", "endereco": "Rua Límpido Córrego n988"}'
obj = json.loads(res)
data = json.dumps(obj)
print(data)
@davidalves1
davidalves1 / install_mysql.sh
Created May 19, 2017 05:24 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Tested with Ubuntu 16.04.
#! /usr/bin/env bash
###
#
# install_mysql.sh
#
# This script assumes your Vagrantfile has been configured to map the root of
# your application to /vagrant and that your web root is the "public" folder
# (Laravel standard). Standard and error output is sent to
# /vagrant/vm_build.log during provisioning.
@davidalves1
davidalves1 / free_shipping_magento.md
Last active May 16, 2017 13:56
Não exibir preço no checkout da loja Magento quando for frete grátis

Para não exibir o valor do frete no checkout quando for frete grátis:

  • Checkout: Ir até o arquivo app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml substituir o código /*Line 61*/ <?php echo $_excl; ?> pelo código abaixo:
<?php if ($_rate->getPrice() > 0): ?>
  <?php echo $_excl; ?>
<?php endif; ?>
@davidalves1
davidalves1 / bank.py
Last active May 12, 2017 01:51
Arquivos de exemplo para dojo sobre Python
# -*- coding: utf-8 -*-
class Client:
def __init__(self, name, age):
self.name = name
self.age = age
class Account:
def __init__(self, clients, number, balance = 0):
self.clients = clients
@davidalves1
davidalves1 / World Bank.py
Created May 5, 2017 03:11 — forked from fmasanori/World Bank.py
Acessa o Banco Mundial via api wb_data, plota o gráfico comparando três países segundo o GNI
#baseado em https://blogs.worldbank.org/opendata/accessing-world-bank-data-apis-python-r-ruby-stata
import wbdata
import matplotlib.pyplot as plt
#set up the countries I want
countries = ["CL","UY","BR"]
#set up the indicator I want (just build up the dict if you want more than one)
indicators = {'NY.GNP.PCAP.CD':'GNI per Capita'}
@davidalves1
davidalves1 / mac_terminal_shortcuts.md
Last active May 3, 2017 01:10
Shortcut list to Mac terminal
Shortcut Description
Ctrl + a Go to the beginning of the line
Ctrl + e Go to the ending of the line
Ctrl + k Erase all after the cursor
Ctrl + w Erase the word before the cursor
Ctrl + u Erase all the line
Ctrl + l Clear the terminal buffer
Ctrl + r Find recently used commands
Ctrl + c Kills the current line