Skip to content

Instantly share code, notes, and snippets.

View Supitto's full-sized avatar

Henrique Almeida Marcomini Supitto

View GitHub Profile
@Supitto
Supitto / igualarobjetos.cs
Last active September 20, 2016 19:42
Exemplo da consequência de igualar objetos
using System;
public class Classe
{
public int x;
public Classe(int _x)
{
this.x = _x;
}
public Classe(Classe _x)
@Supitto
Supitto / sms_example.php
Created January 31, 2018 05:08
An example of a page that recives a post and sens a sms using totalvoice api
<?php
$token = "your token";
$totalvoice_endpoint = "https://api.totalvoice.com.br";
$numero_destino = $_POST['numero_destino'];
$mensagem = $_POST['mensagem'];
$wait = false;
$multi = true;
$request = new HttpRequest($totalvoice_endpoint, HttpRequest::METH_POST);
var xPositions = [];
var yPositions = [];
var gera_arrays = function (quantidade_de_gotas)
{
for(var i = 0; i < quantidade_de_gotas; i++)
{
xPositions.push((Math.random()*400)+1);
yPositions.push((Math.random()*400)+1);
}
@Supitto
Supitto / merge.js
Created March 6, 2018 23:03
just some merge experiments
// original code - made by Adam Bene
const merge = (a, b) => a.reduce(
(acc,curr, i) => [...acc,curr,b[i]]
, []
);
console.log("merge : "+merge([1,2],[3,4]))
//[1,3,2,4]
//But then Adrian Lemes worried about the index
@Supitto
Supitto / amazon_scrape.py
Created March 7, 2018 01:38
a working example of amazon scrape
#Based on the code of Rick Pine
#Original Code : https://gist.github.com/RWhiteDev/75524a79ad5448c0f7597c8cda340019
import requests
from bs4 import BeautifulSoup
for i in range(1,6):
print("page {} : ".format(i))
url = "https://www.amazon.com/Best-Sellers-Kindle-Store-Dystopian-Science-Fiction/zgbs/digital-text/6361470011/ref=zg_bs_pg_{}?_encoding=UTF8&pg={}&ajax=1".format(i,i)
r = requests.get(url)
@Supitto
Supitto / cgal.sh
Created March 7, 2018 10:54
cgal make commands
cgal_create_CMakeLists -s executable
cmake -DCGAL_DIR=$HOME/CGAL-4.11.1 .
make
@Supitto
Supitto / index.html
Created March 27, 2018 13:42
Arquivo bonito pro pedro
<!DOCTYPE html>
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
#include <iostream>
using namespace std;
int calculo(int valorAtual, int proximoValor)
{
cout << valorAtual / proximoValor << " notas de "<< proximoValor << ",00" << endl;
return valorAtual % proximoValor;
}
@Supitto
Supitto / triangle.c
Created August 10, 2018 20:59
simple opengl triangle with an x window
//from https://www.youtube.com/watch?v=C-jp-_Dlz6E
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>
/* GLX headers */
/*
* Descrição:
* Este programa é um utilitario de inserção e recuperação de registros
* de alunos.
*
* Autor:
* Henrique Almeida Marcomini - 619957
*
* Especificações:
* https://drive.ufscar.br/d/2947e699b2/files/?p=/trabalhos/t1/trabalho_1_mobile.pdf