Skip to content

Instantly share code, notes, and snippets.

@vipertechofficial
vipertechofficial / gist:80a209cc9d39edf83820a4e8796f42f7
Created October 12, 2026 08:09
Swipe Files for the Lazy Copywriter.md

Swipe Files for the Lazy Copywriter

Published by www.FreelanceWriting.com
Cover design and graphics: © Brian Scott


Legal Notice

The Publisher has strived to be as accurate and complete as possible in the creation of this ebook, notwithstanding the fact that he does not warrant or represent at any time that the contents within are accurate due to the rapidly changing nature of the Internet.

@vipertechofficial
vipertechofficial / KissDB2.js
Last active October 1, 2024 00:24
A database system for javascript
"use strict";
/*
The MIT License (MIT)
Copyright (c) 2024 Matias Affolter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
/*
The MIT License (MIT)
Copyright (c) 2023 - 2023 Matias Affolter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
/*
The MIT License (MIT)
Copyright (c) 2023 Matias Affolter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@vipertechofficial
vipertechofficial / HybridEncoder.js
Created January 24, 2023 17:48
Hybrid JSON / UINT8ARRAY... BINARY SERIALIZER (with json string yet parsed with utf-zap and concatenated at the end of the uint8array)
/*
The MIT License (MIT)
Copyright (c) 2023 Matias Affolter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@vipertechofficial
vipertechofficial / Nuclei.js
Last active January 10, 2023 13:25
Working on a FASTER BYTE array from/to OBJECT SERIALIZER with Head (three), Neck (properties heap) and Body (values heap)
/*
* The MIT License (MIT)
*
* Copyright (c) 2023 Affolter Matias
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@vipertechofficial
vipertechofficial / Elemental92.js
Last active January 3, 2023 22:30
AWESOME - Get your base64 a bit of futurism --> BASE 92 !!!
/*
* The MIT License (MIT)
*
* Copyright (c) 2023 Affolter Matias
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@vipertechofficial
vipertechofficial / cloudflare-deepai-web-worker-api-javascript.js
Created May 4, 2022 15:57
Use cloudflare and base64 to work with deepAI image processing easily without having to use the API-KEY in client-side...
// CLIENT-SIDE
function postJSON(url, payload, callback_function, content_type = "application/x-www-form-urlencoded") {
// This function is required because JSON is weird with some char
function clean_json_text(json_text) {
json_text = json_text.replace(/\\n/g, "\\n")
.replace(/\\'/g, "\\'")
.replace(/\\"/g, '\\"')
@vipertechofficial
vipertechofficial / resize-image-javascript.js
Created May 4, 2022 12:43
Resize Images in JavaScript in Web Worker with fallback using try catch to make it work on the main thread in old browser too
// CONST:
// imgd_data (you get img_data using a canvas, please get familiar with canvas)
// no_transparent (Boolean to know which file format to use)
// pxl_width (Simply width of the image)
// pxl_height (Simply height of the image)
// resize_width (Which size of width will it get at the end?)
try { // Can work in Web Worker so you can run it on a CPU thread different from the main one which doesn't freeze the UI
var imgd = null;
@vipertechofficial
vipertechofficial / get-a-map-of-colors-in-javscript.js
Created April 30, 2022 19:53
Get a map of pixel and their corresponding colors in Javascript so in other words a palette and a list of the color index (to be used with my other gist and something like RGBQuant.js)
_get_pixels_palette_and_list_from_image_data = (image_data) => {
const image_data_data = image_data.data;
let new_pxl_colors = [];
let new_pxl_colors_set = new Set();
let new_pxls = new Array(image_data.width * image_data.height);
for (let i = 0; i < image_data_data.length; i += 4) {
const color_hex = this._get_hex_color_from_rgba_values(image_data_data[index], image_data_data[index+1], image_data_data[index+2], image_data_data[index+3]);