Skip to content

Instantly share code, notes, and snippets.

View ciro-maciel's full-sized avatar

Ciro Cesar Maciel ciro-maciel

View GitHub Profile
@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
@ciro-maciel
ciro-maciel / getTitleNative.js
Created May 24, 2023 13:36 — forked from jbinto/getTitleNative.js
Get title from remote HTML URL - without jQuery
// Only using native browser features (no jQuery).
// Uses `fetch`, `DOMParser` and `querySelectorAll`.
const getTitle = (url) => {
return fetch(`https://crossorigin.me/${url}`)
.then((response) => response.text())
.then((html) => {
const doc = new DOMParser().parseFromString(html, "text/html");
const title = doc.querySelectorAll('title')[0];
return title.innerText;
add_filter('wfacp_enable_delay_discounting',function (){
return false;
},100);
@ciro-maciel
ciro-maciel / Dexie.min.js
Created August 19, 2022 09:41 — forked from nolanlawson/Dexie.min.js
IndexedDB+Dexie+Lunr MTG full-text search demo
(function(n,t,i,r){"use strict";function h(n,t){return typeof t!="object"&&(t=t()),Object.keys(t).forEach(function(i){n[i]=t[i]}),n}function y(n){return{from:function(t){return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,{extend:function(i){h(n.prototype,typeof i!="object"?i(t.prototype):i)}}}}}function p(n,t){return t(n)}function f(t){function or(){if(i)w.on("versionchange",function(t){w.close();t.newVersion&&n.location.reload(!0)})}function ki(n){this._cfg={version:n,storesSource:null,dbschema:{},tables:{},contentUpgrade:null};this.stores({})}function sr(n,t,i,r){var e,f,o,h,l,c;if(n==0)Object.keys(pt).forEach(function(n){di(t,n,pt[n].primKey,pt[n].indexes)}),e=w._createTransaction(kt,ri,pt),e.idbtrans=t,e.idbtrans.onerror=s(i,["populating database"]),e.on("error").subscribe(i),u.newPSD(function(){u.PSD.trans=e;try{w.on("populate").fire(e)}catch(n){r.onerror=t.onerror=function(n){n.preventDefault()};try{t.abort()}catch(f){}t.db.close();i(n)}});else{if(f=[],o=ii.filter(function(t){return
--targetusername = -u (To specify a non-default scratch org)
--targetdevhubusername = -v (To specify a non-default Dev Hub org)
--setdefaultdevhubusername = -d
--setdefaultusername = -s
--instanceurl = -r
--setalias = -a
@ciro-maciel
ciro-maciel / conventional-commits.md
Last active October 28, 2021 18:07 — forked from Zekfad/conventional-commits.md
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change in API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes wich doesn't change source code or tests e.g. chnages to the build process, auxiliary tools, libraries
@ciro-maciel
ciro-maciel / stimulus.md
Created January 7, 2021 22:31 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet