Skip to content

Instantly share code, notes, and snippets.

View diegoMontesinos's full-sized avatar
😊
Working from home

Diego Montesinos diegoMontesinos

😊
Working from home
View GitHub Profile
{"user_id":1751,"notes":"","listing_comparison_id":18199936548,"listings":[{"listing_id":212021612,"shop_id":10313260,"shop_name":"DoughnutShop","shop_url":"https:\/\/www.dmontesinos-search.vm.dev.etsycloud.com\/shop\/DoughnutShop","title":"Youtiao","has_variations":true,"has_color_variations":true,"is_sold_out":false,"price":"21.00","quantity":15,"currency_code":"USD","url":"https:\/\/www.dmontesinos-search.vm.dev.etsycloud.com\/listing\/212021612\/youtiao","state":0,"is_download":false,"for_public_consumption":true,"logging_key":null,"accepts_gift_card":true,"logging":{"seller_currency":"USD","seller_currency_price":"21","seller_currency_price_int":2100},"image":"http:\/\/img-dev.etsystatic.com\/10313260\/r\/il\/9957b0\/900027406\/il_fullxfull.900027406_agmt.jpg","image170":"http:\/\/img-dev.etsystatic.com\/10313260\/r\/il\/9957b0\/900027406\/il_170x135.900027406_agmt.jpg","img":{"image_id":900027406,"owner_id":10313260,"url":"https:\/\/img-dev.etsystatic.com\/10313260\/r\/il\/9957b0\/900027406\/il_fullxful
{"user_id":1751,"notes":"","listing_comparison_id":18199936548,"listings":[{"listing_id":212021612,"shop_id":10313260,"shop_name":"DoughnutShop","shop_url":"https:\/\/www.dmontesinos-search.vm.dev.etsycloud.com\/shop\/DoughnutShop","title":"Youtiao","has_variations":true,"has_color_variations":true,"is_sold_out":false,"price":"21.00","quantity":15,"currency_code":"USD","url":"https:\/\/www.dmontesinos-search.vm.dev.etsycloud.com\/listing\/212021612\/youtiao","state":0,"is_download":false,"for_public_consumption":true,"logging_key":null,"accepts_gift_card":true,"logging":{"seller_currency":"USD","seller_currency_price":"21","seller_currency_price_int":2100},"image":"http:\/\/img-dev.etsystatic.com\/10313260\/r\/il\/9957b0\/900027406\/il_fullxfull.900027406_agmt.jpg","image170":"http:\/\/img-dev.etsystatic.com\/10313260\/r\/il\/9957b0\/900027406\/il_170x135.900027406_agmt.jpg","img":{"image_id":900027406,"owner_id":10313260,"url":"https:\/\/img-dev.etsystatic.com\/10313260\/r\/il\/9957b0\/900027406\/il_fullxful
{"user_id":1751,"notes":"","listing_comparison_id":18199936548,"listings":[{"listing_id":212021612,"shop_id":10313260,"shop_name":"DoughnutShop","shop_url":"https:\/\/www.dmontesinos-search.vm.dev.etsycloud.com\/shop\/DoughnutShop","title":"Youtiao","has_variations":true,"has_color_variations":true,"is_sold_out":false,"price":"21.00","quantity":15,"currency_code":"USD","url":"https:\/\/www.dmontesinos-search.vm.dev.etsycloud.com\/listing\/212021612\/youtiao","state":0,"is_download":false,"for_public_consumption":true,"logging_key":null,"accepts_gift_card":true,"logging":{"seller_currency":"USD","seller_currency_price":"21","seller_currency_price_int":2100},"image":"http:\/\/img-dev.etsystatic.com\/10313260\/r\/il\/9957b0\/900027406\/il_fullxfull.900027406_agmt.jpg","image170":"http:\/\/img-dev.etsystatic.com\/10313260\/r\/il\/9957b0\/900027406\/il_170x135.900027406_agmt.jpg","img":{"image_id":900027406,"owner_id":10313260,"url":"https:\/\/img-dev.etsystatic.com\/10313260\/r\/il\/9957b0\/900027406\/il_fullxful
class Sketch {
constructor(opts) {
this.scene = new THREE.Scene();
this.vertex = `varying vec2 vUv;void main() {vUv = uv;gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );}`;
this.fragment = opts.fragment;
this.uniforms = opts.uniforms;
this.renderer = new THREE.WebGLRenderer();
this.width = window.innerWidth;
this.height = window.innerHeight;
this.renderer.setPixelRatio(window.devicePixelRatio);
void setup () {
size(900, 900, P3D);
smooth();
frameRate(60);
}
void draw () {
background(255);
float thetaRes = TWO_PI / 128;
// Implementation of MontyHall problem with 3 doors.
// https://en.wikipedia.org/wiki/Monty_Hall_problem
int wins = 0;
int losses = 0;
int games = 1000000;
for (int i = 0; i < games; i++) {
@diegoMontesinos
diegoMontesinos / svg2tex.py
Created January 15, 2018 19:08
Python script to export SVG files to LaTeX using Inkscape
#!/usr/bin/python
import argparse
import os
import sys
from subprocess import call
# Current working directory
cwd = os.getcwd()
// In .html <script src="tuio-to-touch.js"></script>
// Create TUIO client
var Tuio = require('tuio-nw');
var TuioClient = new Tuio.Client();
TuioClient.listen();
// Init the bridge: tuio events -> touch events
TuioToTouch.init(TuioClient);
'use strict';
// Globals
var WebSocket = require('ws');
var WS_PORT = 1881;
var inputClients = [];
var outputClients = [];
var id = 0;