Skip to content

Instantly share code, notes, and snippets.

Avatar
❄️
Focusing

Esteve Segura EsteveSegura

❄️
Focusing
View GitHub Profile
View discordAuth.js
const express = require('express');
const btoa = require('btoa');
const fecth = require('node-fetch');
const app = express();
const idDiscord = 'xxxxxxxxxxxxxxxx';
const secretDiscord = 'xxxxxxxxxxxxxxxx';
const redirect = 'http://localhost:3000/callback';
View Montecarlo.js
let r = 5;
let points_total = 0;
let points_inside = 0;
while (1) {
points_total++;
let x = Math.random() * r * 2 - r
let y = Math.random() * r * 2 - r
@EsteveSegura
EsteveSegura / FindIndexPi.js
Created Jul 17, 2020
Encontrar strings dentro de pi!
View FindIndexPi.js
const fs = require('fs')
let preLoadPi = fs.readFileSync('./pi-billion.txt', 'utf-8')
function findIndexInPi(str,pi){
let n = parseInt(str,36)
let index = preLoadPi.indexOf(n)
let nL = n.toString().split("").length
let numInPi = ""
@EsteveSegura
EsteveSegura / Ball.cs
Created Mar 9, 2020
Ball controller.
View Ball.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ball : MonoBehaviour{
public Rigidbody rb;
public float force;
void Start(){
View TwitchManager.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.ComponentModel;
using System.Net.Sockets;
using System.IO;
public class TwitchIntegration : MonoBehaviour{
View tips.html
<!DOCTYPE html>
<html lang="es">
<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">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css">
<title>neighborhoodSign</title>
<style>
View admin.js
//Collecting data using jquery
function collectData(id) {
let dataCollected = { 'name': "", data: [] }//[]
$(`#${id}`).children('').each((i, el) => {
dataCollected.name = el.id.slice(0, -1);
if (el.tagName == "INPUT") {
dataCollected.data.push({ 'name': el.id, 'data': $(el).val() })
}
})
return dataCollected
View server.js
const http = require('http');
const morgan = require('morgan');
const express = require('express');
const bodyParser = require('body-parser');
const socketIo = require('socket.io');
const app = express();
const server = http.createServer(app);
const routes = require('./routes/routes');
const io = socketIo(server);
@EsteveSegura
EsteveSegura / bot.js
Created Oct 21, 2019
bot js final file
View bot.js
const download = require('image-downloader')
const detectFood = require('./detectFood');
//read txt file and convert to array
function readFileLineByLine(dataPath){
return new Promise(function(resolve,reject){
let dataset = []
let rl = readline.createInterface({
input: fs.createReadStream(dataPath)
View burgerSetences.txt
Have you cooked it? good. I only perceive one thing from this cheeseburger: flavor
Wow.... That burger just 'good cooking'. Can i bite it
I want to try that food, it looks delectable. Wow.... That burger just 'flavor'
Too delicious. The burger talks about ''good cooker''
I want to try that food, it looks delicious. looking that burger you can perceive: good cooking
Wow.... That burger just 'good cooking'. The photo tells me that i must attack it
It seems delicious. I only perceive one thing from this cheeseburger: made with love
I want to try that food, it looks delectable. Wow.... That burger just 'good cooking'
I only perceive one thing from this cheeseburger: good cooker. I want to eat it
That food looks like fine. I only perceive one thing from this cheeseburger: good cooker