Skip to content

Instantly share code, notes, and snippets.

View jaronwanderley's full-sized avatar

Jaron Wanderley jaronwanderley

View GitHub Profile
@alenaksu
alenaksu / rdp.ts
Last active November 8, 2024 11:31
Ramer-Douglas-Peucker implementation
interface Point {
x: number;
y: number;
}
/**
* Compute the perpendicular distance between a point and a line
* @param point
* @param line
*/
@iffy
iffy / .gitignore
Last active May 19, 2025 13:56
Example using electron-updater with `generic` provider.
node_modules
dist/
yarn.lock
wwwroot
@alenaksu
alenaksu / sutherland–hodgman.js
Last active July 16, 2024 01:04
Sutherland–Hodgman algorithm
function isInside(p, [a, b]) {
return (b[0] - a[0]) * (p[1] - a[1]) > (b[1] - a[1]) * (p[0] - a[0]);
}
function getEdges(polygon) {
let edges = [];
for (let i = 0; i < polygon.length; i++) {
let edge = [polygon[(i + polygon.length - 1) % polygon.length], polygon[i]];
@mfd
mfd / 06.png
Last active September 6, 2025 20:50
Gilroy font
06.png
@nyancodeid
nyancodeid / README.md
Last active May 22, 2025 21:02
Make RESTful API with Google Apps Script and SpreadSheet

Google Script CRUD

By Ryan Aunur Rassyid

Simply create RESTful API with Google Script and store it to Google SpreadSheet like a Pro.

@jcormont
jcormont / barcode-128-svg.js
Created October 12, 2017 15:00
Simple Code-128 (128B) barcode SVG generator, in vanilla JS
var Barcode128Svg = (function () {
function Barcode128Svg(input) {
this.input = input;
this.factor = 2;
this.height = 75;
}
var lookup = {}, data = "212222222122222221121223121322131222122213122312132212221213221312231212112232122132122231113222123122123221223211221132221231213212223112312131311222321122321221312212322112322211212123212321232121111323131123131321112313132113132311211313231113231311112133112331132131113123113321133121313121211331231131213113213311213131311123311321331121312113312311332111314111221411431111111224111422121124121421141122141221112214112412122114122411142112142211241211221114413111241112134111111242121142121241114212124112124211411212421112421211212141214121412121111143111341131141114113114311411113411311113141114131311141411131".split(/(\d{6})/).filter(function (s) { return !!s });
for (var i = 32; i < 127; i++)
lookup[String.fromCharCode(i)] = [i - 32, data[i - 32]];
@elclanrs
elclanrs / README.md
Last active July 4, 2025 13:23
VanillaJS popover with autoposition
//Task: Find the greatest common divisor for an array of integers
//Tags: array, gcd
let arr = [6, 9, 21]
let gcd = function(a, b) {
a = Math.abs(a)
b = Math.abs(b)
while (a != b) {
if (a > b) a -= b
<template>
<!-- Will add/remove .small if the width is less / greater -->
<div class="post__item" v-responsive="{ small: el => el.width <= 500 }">
<img class="post__image" :src="post.image" />
<div class="post__text">{{post.text}}</div>
</div>
</template>
<script>
import { ResponsiveDirective } from "vue-responsive-components"
@ianholing
ianholing / simpletest_raspicam.cpp
Created June 12, 2018 07:27
First attempt for detecting bright points
#include <ctime>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <unistd.h>
#include <raspicam/raspicam.h>
#include <signal.h>
//#include <stdlib.h>