Skip to content

Instantly share code, notes, and snippets.

View iursevla's full-sized avatar

Rui Alves iursevla

View GitHub Profile
@iursevla
iursevla / static_server.js
Created November 21, 2015 23:02 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@iursevla
iursevla / html5-video-streamer.js
Created November 27, 2016 17:11 — forked from paolorossi/html5-video-streamer.js
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@iursevla
iursevla / rtree.js
Created March 14, 2017 11:09
rtree
/**
* Exports a `PolygonLookup` constructor, which constructs a data-structure for
* quickly finding the polygon that a point intersects in a (potentially very
* large) set.
*/
var pointInPolygon = function (point, vs) {
// ray-casting algorithm based on
// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
@iursevla
iursevla / worker.js
Last active May 21, 2017 17:27
CSV process worker
let numMsgsReceived = 0; //Number messages received
let options = null; //Save options
let headerIndeces = []; //Indeces of header to save
/**
* Receive options and file to read from main Thread.
*/
this.onmessage = function (e) {
if (numMsgsReceived === 0) { //Save options
options = e.data;
@iursevla
iursevla / CSVParser.html
Last active May 22, 2017 20:59
CSV Parser
<!DOCTYPE html>
<html lang="en">
<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">
<title>CSV Parser</title>
<script src="CSVParser.js"></script>
</head>
@iursevla
iursevla / Test.html
Created May 23, 2017 20:24
Test usage of Papa Parser 4
<!DOCTYPE html>
<html lang="en">
<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">
<title>Novo Parser</title>
<script src="papaparse.js"></script>
<script src="Test.js"></script>
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://coinmarketcap.com/
// @grant none
// ==/UserScript==
@iursevla
iursevla / generate-exports.ts
Created June 13, 2024 16:57
Generate index.ts for all typescript files within your project
import fs from 'fs';
import * as path from 'node:path';
// Directory containing your components
const srcDir = path.resolve(__dirname, 'src');
// Output file
const indexFile = path.resolve(__dirname, 'src/index.ts');
// Helper function to recursively get all TypeScript files
@iursevla
iursevla / frigate_config.yaml
Created August 4, 2024 20:07
Frigate config for Reolink RLC_410W
# yaml-language-server: $schema=http://192.168.1.11:5000/api/config/schema.json
version: 0.14
mqtt:
enabled: true
host: mqtt5
detect:
# NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.