Skip to content

Instantly share code, notes, and snippets.

@giuliohome
giuliohome / my_video_capture.html
Created March 14, 2023 16:27
video capture, html5
<!DOCTYPE html>
<html>
<body>
<h1>Recording Video from the User</h1>
<p>Acquire access to the camera</p>
<video id="player" controls></video>
<a id="download">Download</a>
@giuliohome
giuliohome / Dockerfile
Last active February 28, 2024 16:42
alpine node container to build and test react without ssl verification
FROM node:16.14.0-alpine
RUN mkdir my
RUN echo enableStrictSsl: false > ./my/.yarnrc.yml
COPY fe-react-01/yarn.lock ./my
COPY fe-react-01/src ./my/src
COPY fe-react-01/.yarn ./my/.yarn
COPY fe-react-01/tsconfig.json ./my
COPY fe-react-01/package.json ./my
COPY fe-react-01/public ./my/public
@giuliohome
giuliohome / flask-sqlserver-googlekubernetesengine.build-trigger-inline.yaml
Created February 16, 2022 08:49
Google Cloud Run - build trigger - inline yaml
steps:
- name: gcr.io/cloud-builders/docker
args:
- build
- '--no-cache'
- '-t'
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
- .
- '-f'
- Dockerfile
@giuliohome
giuliohome / Makefile
Last active September 13, 2021 22:00
IMGUI + GLFW
# Cross Platform Makefile
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
#
# You will need GLFW (http://www.glfw.org):
# Linux:
# apt-get install libglfw-dev
# Mac OS X:
# brew install glfw
# MSYS2:
# pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw
@giuliohome
giuliohome / StandardShading.fragmentshader
Last active January 16, 2024 22:37
example for GTK GL Area issue
#version 330 core
// Interpolated values from the vertex shaders
in vec2 UV;
in vec3 Position_worldspace;
in vec3 Normal_cameraspace;
in vec3 EyeDirection_cameraspace;
in vec3 LightDirection_cameraspace;
// Ouput data
@giuliohome
giuliohome / 2serv.py
Last active June 1, 2020 18:11 — forked from phrawzty/2serv.py
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
open System
open System.IO
open System.Diagnostics
// my first part was 3247
//Found min cross at steps 48054 X 4537 and Y 4955
//done in (101) ms !
type Point = {X:int; Y:int; Steps: int} with
override this.ToString() = sprintf "(%d,%d,%d)" this.X this.Y this.Steps
open System
open System.IO
let readInts (path:string) : int [] =
use sw = new StreamReader (path)
sw.ReadToEnd().Split(",")
|> Array.map Int32.Parse
type Status = {memory:int[]; position: int; finished: bool;}
type Cmd = {opcode: int; op1:int ; op2: int; dest:int}
open System
open System.IO
let readInts (path:string) =
[|
use sw = new StreamReader (path)
while (not sw.EndOfStream) do
yield sw.ReadLine() |> Int32.Parse
|]
@giuliohome
giuliohome / PostSlack_BackGround.java
Created September 29, 2019 16:31
My Open Twitter Search integrated also with Slack channel, posting as bot
package org.new_year2018;
import android.os.AsyncTask;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;