Skip to content

Instantly share code, notes, and snippets.

View douglas-larocca's full-sized avatar

Douglas La Rocca douglas-larocca

View GitHub Profile
@hanxiao
hanxiao / testRegex.js
Last active April 22, 2025 02:43
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
@velzie
velzie / manifest-v2-chrome.md
Last active April 20, 2025 14:00
How to keep using adblockers on chrome and chromium

How to keep using adblockers on chrome and chromium

  1. google's manifest v3 has no analouge to the webRequestBlocking API, which is neccesary for (effective) adblockers to work
  2. starting in chrome version 127, the transition to mv3 will start cutting off the use of mv2 extensions alltogether
  3. this will inevitably piss of enterprises when their extensions don't work, so the ExtensionManifestV2Availability key was added and will presumably stay forever after enterprises complain enough

You can use this as a regular user, which will let you keep your mv2 extensions even after they're supposed to stop working

Linux

In a terminal, run:

FROM tensorflow/tensorflow:1.13.2-py3
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y && apt upgrade -y && apt install git -y
RUN git clone https://github.com/openai/gpt-2 /gpt-2
WORKDIR /gpt-2
RUN python3 -m pip install --upgrade pip && python3 -m pip install -r requirements.txt
RUN python3 download_model.py 124M
@skeeto
skeeto / README.md
Last active September 23, 2024 02:16
AI driving simulation
@nicebyte
nicebyte / dyn_arr.h
Last active February 25, 2025 10:29
dyn_arr
#pragma once
#define DYN_ARR_OF(type) struct { \
type *data; \
type *endptr; \
uint32_t capacity; \
}
#if !defined(__cplusplus)
#define decltype(x) void*
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@ErikAugust
ErikAugust / spectre.c
Last active January 5, 2025 07:01
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@terabyte
terabyte / amazon.md
Created December 6, 2017 02:27
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

anonymous
anonymous / list27.txt
Created May 8, 2016 17:40
000(023Rb|001Rb)
001(017La|002Rb)
002(021La|003Rb)
003(021La|004La)
004(009Rb|005Lb)
005(004Ra|005La)
006(008La|007La)
007(009Rb|007La)
008(009Ra|008La)
009(010Ra|026Ra)
@JoeyChor
JoeyChor / checker.py
Last active April 15, 2025 14:11
Checks if an email exists on a mail server.
import sys, argparse, time, telnetlib
try:
import socks
except ImportError:
print("Proxy support is disabled.")
parser = argparse.ArgumentParser()
parser.add_argument("-e", "--email", help="The email to check")
parser.add_argument("-n", "--nameserver", help="The email server")
parser.add_argument("-p", "--nsport", help="The server port", type=int)
parser.add_argument("-t", "--timeout", help="The timeout in seconds", type=int)