Skip to content

Instantly share code, notes, and snippets.

View beginor's full-sized avatar
💭
Coding for code!

beginor beginor

💭
Coding for code!
View GitHub Profile
@beginor
beginor / cesium.d.ts
Created October 4, 2017 01:37 — forked from thw0rted/cesium.d.ts
Updated typings file for Cesium v1.37.0
/**
* Cesium type definitions
* For use with Cesium v1.37.0
* Created by Aigars Zeiza <https://github.com/Zuzon>
* Modified by Harry Nicholls <[email protected]>
* Updated for v1.37.0 by James Bromwell <https://github.com/Thw0rted>
*/
declare module "cesium"{
type RenderState = any;
@beginor
beginor / fix-geometries.py
Created April 13, 2021 00:05 — forked from jsanz/fix-geometries.py
Python - QGIS - Fix geometries
"""
Small script to fix geometries of the first file argument
using the native QGIS processing algorithm. You may need
to adjust the path to you installation.
"""
import sys
sys.path.append('/usr/share/qgis/python/plugins')
from processing.core.Processing import Processing
@beginor
beginor / chunking-regex.ts
Created August 15, 2024 07:34 — forked from hanxiao/testRegex.js
Use regex to do chunking by using all semantic cues
// Used in https://jina.ai/tokenizer (Aug. 14th version)
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 6;
const MAX_HEADING_CONTENT_LENGTH = 200;
const MAX_HEADING_UNDERLINE_LENGTH = 200;
const MAX_HTML_HEADING_ATTRIBUTES_LENGTH = 100;
const MAX_LIST_ITEM_LENGTH = 200;
const MAX_NESTED_LIST_ITEMS = 5;
const MAX_LIST_INDENT_SPACES = 7;
const MAX_BLOCKQUOTE_LINE_LENGTH = 200;