Skip to content

Instantly share code, notes, and snippets.

View jonybekov's full-sized avatar
💭
I may be slow to respond.

R4Y jonybekov

💭
I may be slow to respond.
View GitHub Profile
@jonybekov
jonybekov / polygon_split.js
Created February 28, 2024 13:16 — forked from iamgeoknight/polygon_split.js
Split Polygon by Line
onGeomChange = (e) => {
/*
This function will dynamically split the polygon into two parts by a line and will follow geometry change event.
*/
//Create jsts parser to read openlayers geometry
let parser = new jsts.io.OL3Parser();
//Creating line geometry from draw intraction
let linestring = new ol.Feature({
@jonybekov
jonybekov / intersection.ts
Last active February 28, 2024 13:10
Find line-line and polygon-line intersection
function Intersection(status) {
if ( arguments.length > 0 ) {
this.init(status);
}
}
/*****
*
@jonybekov
jonybekov / gist:cc0ab1e679bd9221cace3c3ae98aa18f
Last active October 3, 2023 15:24
First person camera experience
import React from "react";
import * as THREE from "three";
import { useThree, useFrame } from "react-three-fiber";
import { useDrag, useMove } from "react-use-gesture";
import lerp from "lerp";
import gsap from "gsap";
import _ from "lodash";
import { useModel } from "../../state/Store";
function findIntersectItems(array, activeFloor) {
@jonybekov
jonybekov / closure.js
Last active February 6, 2022 15:33
YDKJS 2: Getting started: Appendix B: Practicing Closure Problem Solution
function range(start,end) {
if(start == end) {
return [start]
}
const printRange = (from, to) => {
if(to === 0) {
return [];
}
return Array((to - from) + 1).fill(null).map((_, i) => start + i)
@jonybekov
jonybekov / schedule-meeting.js
Created February 6, 2022 15:15
YDKJS 2: Getting started: Appendix B: Practicing Comparisons Problem Solution
const dayStart = "07:30";
const dayEnd = "17:45";
function scheduleMeeting(startTime,durationMinutes) {
let [startHour, startMin] = startTime.split(':');
let durationHour = Math.floor(durationMinutes / 60);
let durationLeftMin = durationMinutes - durationHour * 60;
let [endStart, endMin] = [0,0];
endHour = +startHour + durationHour;
@jonybekov
jonybekov / normal-linkedin-logo.js
Last active June 9, 2021 22:14
Normal Linkedin logo
// ==UserScript==
// @name Normal Linkedin logo
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Changes Linkedin's rainbow logo to a normal logo
// @author You
// @match https://www.linkedin.com/*
// @icon https://www.google.com/s2/favicons?domain=linkedin.com
// @grant none
// ==/UserScript==