Skip to content

Instantly share code, notes, and snippets.

@bennotti
bennotti / smart_contract.sol
Created May 17, 2021 14:10 — forked from jcmartinezdev/smart_contract.sol
Access a Smart Contract from your web application
pragma solidity ^0.6.6;
contract CoolNumberContract {
uint public coolNumber = 10;
function setCoolNumber(uint _coolNumber) public {
coolNumber = _coolNumber;
}
}
@bennotti
bennotti / tabela_moedas.sql
Last active September 11, 2018 00:45
dados de moedas importadas do banco central pelo arquivo: https://www4.bcb.gov.br/pec/taxas/batch/tabmoedas.asp?id=tabmoeda
SET IDENTITY_INSERT [tb_moedas] ON
GO
INSERT [tb_moedas] ([moedaId], [nome], [ultimaCotacao], [dataCadastro], [dataUltimaAlteracao], [Ativo], [Codigo], [Simbolo], [CodigoPais], [Pais]) VALUES (321, N'AFEGANE AFEGANIST', CAST(0.00 AS Decimal(18, 2)), CAST(N'2018-09-06T10:09:02.520' AS DateTime), CAST(N'2018-09-06T10:09:02.520' AS DateTime), 1, N'005', N'AFN', N'132', N'AFEGANISTAO')
GO
INSERT [tb_moedas] ([moedaId], [nome], [ultimaCotacao], [dataCadastro], [dataUltimaAlteracao], [Ativo], [Codigo], [Simbolo], [CodigoPais], [Pais]) VALUES (322, N'RANDE/AFRICA SUL', CAST(0.00 AS Decimal(18, 2)), CAST(N'2018-09-06T10:09:02.533' AS DateTime), CAST(N'2018-09-06T10:09:02.533' AS DateTime), 1, N'785', N'ZAR', N'7560', N'AFRICA DO SUL')
GO
INSERT [tb_moedas] ([moedaId], [nome], [ultimaCotacao], [dataCadastro], [dataUltimaAlteracao], [Ativo], [Codigo], [Simbolo], [CodigoPais], [Pais]) VALUES (323, N'LEK ALBANIA REP', CAST(0.00 AS Decimal(18, 2)), CAST(N'2018-09-06T10:09:02.533' AS DateTime), CAST(N'2018-09-06T10:09:02.
@bennotti
bennotti / exportarExcel.js
Last active September 5, 2018 01:24
Exportar para excel em javascript
function exportarExcel(filename){
if(!filename) filename = 'download.xls';
var tab_text = "<table border='2px'>";
tab_text += "<tr bgcolor='#87AFC6'><td>12345</td><td>12345</td><td>12345</td></tr>";
tab_text += "<tr><td>12345</td><td>12345</td><td>12345</td></tr>";
tab_text = tab_text+"</table>";
# Retorna dados sobre o pregão
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDados.asp?CodDado=IBOV,ticker&CA=undefined
# Retorna ações e seus últimos valores negociados
http://www.bmfbovespa.com.br/Pregao-OnLine/ExecutaAcaoCarregarDados.asp?CodDado=Ticker
# Retorna o histórico do dia de um papel
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDadosPapeis.asp?CodDado=petr4
# Retorna dados de um papel
@bennotti
bennotti / bovespa.py
Created August 25, 2018 23:51 — forked from turicas/bovespa.py
Get stock prices from BMF Bovespa API
# coding: utf-8
# Copyright 2015 Álvaro Justen <https://github.com/turicas/rows/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@bennotti
bennotti / program.cs
Last active August 24, 2018 03:49
Calcula Total de Horas de uma lista de DateTime
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
static TimeSpan CalculaTotalHoras(IList<DateTime> lista){
lista = lista.OrderBy(p => p).ToList();
var listaDatas = lista.GroupBy(p => p.Date).Select(p => p.Key).ToList();
@bennotti
bennotti / webfonts.css
Created June 25, 2017 22:49 — forked from tomswatermelon/webfonts.css
Webfonts CSS
/*Roboto*/
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(fonts/Roboto-Thin.ttf) format('truetype');
}
@font-face {
font-family: 'Roboto';
font-style: normal;