Skip to content

Instantly share code, notes, and snippets.

View IgorDePaula's full-sized avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
@IgorDePaula
IgorDePaula / Tray.js
Created February 27, 2020 17:12
Tray.js
import { app, BrowserWindow, nativeTheme, Menu, Tray, nativeImage } from 'electron'
const path = require('path')
let tray = null
try {
if (process.platform === 'win32' && nativeTheme.shouldUseDarkColors === true) {
require('fs').unlinkSync(require('path').join(app.getPath('userData'), 'DevTools Extensions'))
}
} catch (_) { }
{"status":
{"cvc": "incomplete", "expiry": "incomplete", "number": "incomplete"},
"valid": false,
"values":
{"cvc": "", "expiry": "", "number": "5234", "type": "master-card"}
}
@IgorDePaula
IgorDePaula / README.md
Created January 21, 2020 21:47 — forked from curran/README.md
The Iris Dataset

This is the "Iris" dataset. Originally published at UCI Machine Learning Repository: Iris Data Set, this small dataset from 1936 is often used for testing out machine learning algorithms and visualizations (for example, Scatter Plot). Each row of the table represents an iris flower, including its species and dimensions of its botanical parts, sepal and petal, in centimeters.

The HTML page provides the basic code required to load the data and display it on the page (as JSON) using D3.js.

function deg2rad(deg) {
return deg * (Math.PI / 180);
}
module.exports = function getDistanceFromLatLonInKm(
centerCoordinates,
pointCoordinates
) {
const radius = 6371;
#!/usr/bin/make
include .env
export
.PHONY: help
.DEFAULT_GOAL := help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
const request = require('request'),
fs = require('fs'),
path = require('path'),
pathRead = 'http://www.inmetro.gov.br/da/registro/LAMPADAS_LED_COM_DISPOSITIVO_INTEGRADO_A_BASE.csv',
pathWrite = 'LAMPADAS_LED_COM_DISPOSITIVO_INTEGRADO_A_BASE.csv'
const downloadCsv = async (pathRead, pathWrite) => {
await request(pathRead).on('end', (err, data) => {
console.log('=> Download concluído')
#!/bin/bash
if [ `git rev-parse --abbrev-ref HEAD` == "master" ]; then
sh build-frontend.sh
elif [ `git rev-parse --abbrev-ref HEAD` == "homologacao" ]; then
sh makeFrontend.sh
fi
@IgorDePaula
IgorDePaula / teste.html
Last active December 3, 2019 17:38
reconhecendo ponto no browser por upload
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<button id="camera">camera</button>
<button id="screenshot">screenshot</button>
<input type="file" id="file">
@IgorDePaula
IgorDePaula / client.js
Created November 1, 2019 18:28 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@IgorDePaula
IgorDePaula / shared.html
Last active November 25, 2019 01:15
pega compartilhado da area de trabalho, joga no video, renderiza no canvas e grava como webm
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
#canvas{
border:1px solid red;
}
</style>