Skip to content

Instantly share code, notes, and snippets.

View alancpazetto's full-sized avatar
🏋️
Front-End @ Stone Co.

Alan Pazetto alancpazetto

🏋️
Front-End @ Stone Co.
View GitHub Profile
@alancpazetto
alancpazetto / my_contracts...FoodChain.sol
Created January 5, 2022 11:32
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract CatalogItem {
string public name;
uint256 public price;
constructor(string memory _name, uint256 _price) {
name = _name;
@alancpazetto
alancpazetto / Dockerfile
Created November 13, 2018 14:25
Docker compose PHP + Mysql + PHPMyAdmin
FROM php:7.0-apache
RUN apt-get update && apt-get install --no-install-recommends -y \
cron \
git \
wget \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libmcrypt-dev \
@alancpazetto
alancpazetto / tone.html
Created August 7, 2018 20:09
Gerar som JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
@alancpazetto
alancpazetto / index.js
Created August 3, 2018 19:34
Machine Learning JS
const fs = require('fs-extra');
const KNN = require('ml-knn');
const moment = require('moment');
const { GaussianNB, MultinomialNB } = require('ml-naivebayes');
const { Matrix } = require('ml-matrix');
const { DecisionTreeClassifier } = require('ml-cart');

Juros LIS / Cheque especial Itaú

Juros ao mês: 11,95%
Juros ao dia: 0,3754%

Conta de juros composto

@alancpazetto
alancpazetto / solucao.txt
Created May 15, 2018 19:13
Problema com caracter invisivel ou ETX
Pra documentar. Aconteceu hoje comigo aquele erro de caractere invisível, uma possível causa é copiar o texto do photoshop e colar no editor de texto.
Comigo funcionou jogar no Google o texto e atualizar a página, todo o texto depois do caractere quebrado não apareceu.
function isChatMessage(message) {
if (message.__x_isSentByMe) {
return false;
}
if (message.__x_isNotification) {
return false;
}
if (!message.__x_isUserCreatedType) {
return false;
}
@alancpazetto
alancpazetto / remove blank lines regex.md
Created February 22, 2018 14:09 — forked from fomightez/remove blank lines regex.md
remove all blank lines using regular expressions
@alancpazetto
alancpazetto / woocommerce-custom-cart-item-data.php
Created November 24, 2017 19:45 — forked from RadGH/woocommerce-custom-cart-item-data.php
Get and set custom cart item/product information prior to WooCommerce checkout, and carry those valus over to Order Item Metadata.
<?php
// UPDATE: Stefan from Stack Overflow has explained a better way to handle cart item data.
// See http://stackoverflow.com/a/32327810/470480
// ----------------------
/*
Instructions:
@alancpazetto
alancpazetto / add-woocommerce-product.php
Created November 23, 2017 13:42 — forked from Yame-/add-woocommerce-product.php
Adding a WooCommerce product programmatically.
<?php
$args = array(
'post_author' => 1,
'post_content' => '',
'post_status' => "draft", // (Draft | Pending | Publish)
'post_title' => '',
'post_parent' => '',
'post_type' => "product"
);