Skip to content

Instantly share code, notes, and snippets.

View danielgindi's full-sized avatar

Daniel Cohen Gindi danielgindi

  • Self Employed, CTO at eyedo fielding technologies ltd.
  • Israel
View GitHub Profile
@danielgindi
danielgindi / node_v11.x_sourceless_script.patch
Last active March 25, 2019 08:17
Patch to add a "sourceless" feature to node.js v11.x
--- a/deps/v8/include/v8.h
+++ b/deps/v8/include/v8.h
@@ -1564,9 +1564,10 @@ class V8_EXPORT ScriptCompiler {
};
enum CompileOptions {
- kNoCompileOptions = 0,
- kConsumeCodeCache,
- kEagerCompile
+ kNoCompileOptions = 0x00,
class LZRW1 {
static #FLAG_BYTES = 4;
static #FLAG_COMPRESS = 0;
static #FLAG_COPY = 1;
static #WORK_MEM_ALLOC = 4 * 4096 + 3;
static #WORKMEM = new Array(LZRW1.#WORK_MEM_ALLOC);
/** @returns {Buffer} */
static compress(/**@type Buffer*/input) {
const WORKMEM = this.#WORKMEM.fill(0);
@danielgindi
danielgindi / MySql_Partitioning.sql
Last active November 5, 2023 10:02
MySql automatic partitioning by RANGE of month/day, no external scripts
DELIMITER $$
DROP TABLE IF EXISTS _partitioned_tables; $$
CREATE TABLE IF NOT EXISTS `_partitioned_tables` (
`owner_name` VARCHAR(100) NOT NULL,
`table_name` VARCHAR(100) NOT NULL,
`column_name` VARCHAR(100) NOT NULL,
`mode` ENUM('day', 'month'),
`future_partitions` INT NOT NULL,
@danielgindi
danielgindi / delete_bitbucket_lfs_files.js
Last active February 24, 2024 01:44
Bulk delete Bitbucket LFS files
(() => {
// Run this in Chrome's console, while in Bitbucket's website and logged in
const csrftoken = document.cookie.match(/\bcsrftoken=(.*?)(?:;| |$)/)[1];
const repoName = window.__initial_state__.section.repository.currentRepository.full_name;
const expiry = 1000 * 60 * 60; // Delete only files older than an hour
let page = 1;
function iterateNext() {
fetch(`https://bitbucket.org/${repoName}/admin/lfs/file-management/?iframe=true&spa=0&page=${page}`, {