Skip to content

Instantly share code, notes, and snippets.

@ciro-maciel
ciro-maciel / .cursorrules
Created June 9, 2025 14:58 — forked from boxabirds/.cursorrules
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors
@ciro-maciel
ciro-maciel / full-text-search-algorithm.js
Created May 31, 2025 00:56 — forked from trevorhreed/full-text-search-algorithm.js
A simple full-text-search algorithm
// Draft 2
ngm.service('searchArray', function(){
let THRESHHOLD = 0;
let FULL_EXACTMATCH_MODIFIER = 1.0;
let FULL_STARTSWITH_MODIFIER = 0.9;
let FULL_CONTAINS_MODIFIER = 0.3;
let FULL_PARTIAL_MODIFIER = 0.3;
let PRECISION = 2;
let re = /[\s\b]+/g;
let search = (term, arr, key) => {
TypeScript 13 hrs 7 mins ██████████▎░░░░░░░░░░ 48.9%
Svelte 7 hrs 29 mins █████▊░░░░░░░░░░░░░░░ 27.9%
YAML 1 hr 45 mins █▎░░░░░░░░░░░░░░░░░░░ 6.5%
JSON 1 hr 12 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.5%
Markdown 1 hr 6 mins ▊░░░░░░░░░░░░░░░░░░░░ 4.1%
@ciro-maciel
ciro-maciel / s3-benchmark.go
Created April 9, 2025 16:36 — forked from glommer/s3-benchmark.go
Benchmarking s3 and s3 express
package main
import (
"bytes"
"context"
"encoding/csv"
"flag"
"fmt"
"log"
"math/rand"
Email: [email protected]
SN: GAWAE-FCWQ3-P8NYB-C7GF7-NEDRT-Q5DTB-MFZG6-6NEQC-CRMUD-8MZ2K-66SRB-SU8EW-EDLZ9-TGH3S-8SGA

This demonstrates the implementation of full text search for documents in Indexed DB.

  • Word-breaking and stemming is used to create a list of terms for each document.
  • Document records are annotated with the list of terms when added to the database.
  • A multi-entry index on the list of terms is populated.
  • A query is similarly processed into a list of terms.
  • A join over the terms is implemented using multiple cursors on the index.

The necessity of annotating records with the word list to populate the index is a limitation of the current Indexed DB API. A feature request to support custom

@ciro-maciel
ciro-maciel / crypto-pbkdf2-example.js
Created April 16, 2024 14:15 — forked from skeggse/crypto-pbkdf2-example.js
Example of using crypto.pbkdf2 to hash and verify passwords asynchronously, while storing the hash and salt in a single combined buffer along with the original hash settings
var crypto = require('crypto');
// larger numbers mean better security, less
var config = {
// size of the generated hash
hashBytes: 32,
// larger salt means hashed passwords are more resistant to rainbow table, but
// you get diminishing returns pretty fast
saltBytes: 16,
// more iterations means an attacker has to take longer to brute force an
@ciro-maciel
ciro-maciel / settings.json
Created February 2, 2024 16:58 — forked from diego3g/settings.json
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@ciro-maciel
ciro-maciel / cron.route.ts
Created December 2, 2023 15:51 — forked from adrianhajdin/cron.route.ts
Web Scraping Full Course 2023 | Build and Deploy eCommerce Price Tracker
import { NextResponse } from "next/server";
import { getLowestPrice, getHighestPrice, getAveragePrice, getEmailNotifType } from "@/lib/utils";
import { connectToDB } from "@/lib/mongoose";
import Product from "@/lib/models/product.model";
import { scrapeAmazonProduct } from "@/lib/scraper";
import { generateEmailBody, sendEmail } from "@/lib/nodemailer";
export const maxDuration = 300; // This function can run for a maximum of 300 seconds
export const dynamic = "force-dynamic";
@ciro-maciel
ciro-maciel / .block
Created October 14, 2023 11:48 — forked from ColinEberhardt/.block
Market Profile Chart
license: mit