Skip to content

Instantly share code, notes, and snippets.

@itwondersteam
itwondersteam / worker.ts
Created January 13, 2026 00:55 — forked from richardscarrott/worker.ts
Cloudflare Workers / Pages `stale-while-revalidate`
import { parse } from 'cache-control-parser';
export default {
async fetch(request: Request, env: {}, ctx: ExecutionContext): Promise<Response> {
try {
const cache = await caches.default;
const cachedResponse = await cache.match(request);
if (cachedResponse) {
console.log('Cache: HIT');
if (shouldRevalidate(cachedResponse)) {
@itwondersteam
itwondersteam / antigravity-click-confirm.js
Last active January 5, 2026 02:28
antigravity - auto click proceed
// ═══════════════════════════════════════════════════════════
// AUTO-CLICKER FOR "Accept" BUTTON
// Searches inside iframes and auto-clicks
// https://www.reddit.com/r/google_antigravity/comments/1po6bs7/auto_accept_agent_commands_in_antigravity/
// ═══════════════════════════════════════════════════════════
(function() {
'use strict';
// ==================== STATE MANAGEMENT ====================
1
2 Log opened at 2023-02-20 23:34:41
3 I: Connecting to configured address/port: host.docker.internal:9000.
4 I: Connected to client. :-)
5 -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/server.php" language="PHP" xdebug:language_version="7.2. 5 34" protocol_version="1.0" appid="13" idekey="XDEBUG_ECLIPSE"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDAT 5 A[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>
6
7 <- feature_get -i 1 -n resolved_breakpoints
8 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="1" feature_name="resolved_breakpoints" 8 supported="0"><![CDATA[0]]></response>
9
10 <- feature_get -i 2 -n notify_ok
-- https://www.reddit.com/r/neovim/comments/og1cdv/neovim_lsp_how_do_you_get_diagnostic_mesages_to/
lua << EOF
-- Location information about the last message printed. The format is
-- `(did print, buffer number, line number)`.
local last_echo = { false, -1, -1 }
-- The timer used for displaying a diagnostic in the commandline.
local echo_timer = nil
@itwondersteam
itwondersteam / nerd_fonts.sh
Created February 16, 2023 12:59 — forked from davidteren/nerd_fonts.md
Install Nerd Fonts via Homebrew [updated & fixed]
# Nerd Fonts for your IDE
# https://www.nerdfonts.com/font-downloads
brew tap homebrew/cask-fonts && brew install --cask font-3270-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-fira-mono-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-go-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-lgc-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-monofur-nerd-font
brew tap homebrew/cask-fonts && brew install --cask font-overpass-nerd-font
@itwondersteam
itwondersteam / OpenSSLExample.cpp
Created January 27, 2022 01:43 — forked from irbull/OpenSSLExample.cpp
Code signing and verification with OpenSSL
#include <iostream>
#include <openssl/aes.h>
#include <openssl/evp.h>
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <assert.h>
@itwondersteam
itwondersteam / CMakeLists.txt
Created November 10, 2021 09:38 — forked from baiwfg2/CMakeLists.txt
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)
@itwondersteam
itwondersteam / a2dp.py
Created November 8, 2021 09:39 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@itwondersteam
itwondersteam / css-outline.js
Created May 31, 2021 21:10
css outline bookmarklet
// https://gist.github.com/addyosmani/fd3999ea7fce242756b1
window.iwShowOutline = !!!window.iwShowOutline;
[].forEach.call(document.querySelectorAll("*"),function(a){
if (window.iwShowOutline) a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)
else a.style.outline='initial'
})

Laravel Str Generate a more truly "random" alpha-numeric string.

    public static function random($length = 16)
    {
        $string = '';

        while (($len = strlen($string)) < $length) {
            $size = $length - $len;