Skip to content

Instantly share code, notes, and snippets.

@Explosion-Scratch
Explosion-Scratch / Bookmarklets.md
Last active December 13, 2024 17:14
Bookmarklets

Copy ChatGPT Transcript as markdown

javascript:void (async () => { let { default: TD } = await import("https://cdn.skypack.dev/turndown");  let json = [   ...document.querySelectorAll(".text-base"), ].map((i) => ({   html: i.innerHTML,   text: i.innerText,   markdown: new TD().turndown(i),   isPrompt: !i.querySelector(".prose"), }));  window.open(   URL.createObjectURL(     new Blob(       [         json           .map((i) =>             i.isPrompt ? `**Prompt**: ${i.text}` : `**ChatGPT**: ${i.markdown}`           )           .join("\n\n"),       ],       { type: "text/plain" }     )   ) ); })()

Google answer

Get a quick answer from google for any question

(async function answer(q) {
  var html = await fetch(
    `https://cors.explosionscratc.repl.co/google.com/search?q=${encodeURI(q)}`,
import requests
import zipfile
import os
def download_chrome_extension(input):
if not input.startswith('https://'):
# Assume input is an extension ID and construct the URL
input = f'https://clients2.google.com/service/update2/crx?response=redirect&prodversion=49.0&x=id%3D{input}%26installsource%3Dondemand%26uc'
import time
import json
from mistralai.client import MistralClient
from mistralai.models.chat_completion import ChatMessage
from pydantic import BaseModel, ValidationError, ConfigDict
from typing import Type, Optional
import os
from dotenv import load_dotenv
load_dotenv()

New tested approach: Build Nvidia driver for rt kernel with installed driver on non rt OS. (tested on July 19, 2024 on zorin17 (equivalent to Ubuntu23.10))

Important

One thing before start the below process is to make sure your non-rt kernel and installed rt-kernel has same or close major version, in my most recent test case, it is 6.5.0 for generic vs 6.6.40 for rt.

Step. 0: First, install the rt kernel but dont boot into the rt version OS right now. Install the Nvidia driver first in your non rt OS. When you installed your OS this has probably been done, but check if you got the nvidia-kernel-source, if not,

@straker
straker / README.md
Last active December 13, 2024 17:10
Basic Snake HTML and JavaScript Game

Basic Snake HTML and JavaScript Game

Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Score
  • When the snake eats an apple, the score should increase by one. Use context.fillText() to display the score to the screen
@wheelcomplex
wheelcomplex / embedded-file-viewer.md
Created October 26, 2017 05:42 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@berkedel
berkedel / import-x509-pk8-to-jks-keystore.md
Created October 12, 2020 10:43
How to import x509.pem pk8 file into jks keystore

How to import x509.pem pk8 file into jks keystore

Prerequiste:

Generate a file platform.priv.pem from you pk8 file.

openssl pkcs8 -in platform.pk8 -inform DER -outform PEM -out platform.priv.pem -nocrypt
@ppoffice
ppoffice / README.md
Last active December 13, 2024 17:05
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@ivan
ivan / cargo.sh
Last active December 13, 2024 17:03
cargo wrapper for NixOS and Rust nightly: mold, target-cpu, -Z share-generics
#!/usr/bin/env bash
# NixOS-only cargo wrapper that:
# - always uses mold for linking.
# - sets `-C target-cpu=haswell` to avoid generating code for pre-2013 CPUs.
# - sets `-C link-arg=-Wl,--compress-debug-sections=zlib-gabi` to compress debug sections.
# - sets LIBCLANG_PATH for projects that need clang.
# - sets `-Z share-generics` to reduce output binary sizes by ~2MB.
# - turns on cargo's sparse-registry feature.
# - increases niceness slightly with `nice -n 2` .
@lucprincen
lucprincen / Save.php
Last active December 13, 2024 17:02
Saves a WordPress FSE pattern on the local environment.
<?php
namespace WotW\Theme\Patterns;
use WotW\Theme\Contracts\Interfaces\Hookable;
class Save implements Hookable{
public function register_hooks(): void {