Skip to content

Instantly share code, notes, and snippets.

@taiwbi
taiwbi / gnome-transparent-sidebar.css
Last active June 12, 2025 09:09
Make Gnome applications sidebar semi-transparent, and add blur with Blur My Shell Extension if you want to
/* Mohammad Mahdi Tayebi
*
* To apply transparent sidebar. copy this file into ~/.config/gtk-4.0/gtk.css and if
* you use adw-gtk3 theme you can add it to ~/.config/gtk-3.0/gtk.css as well
*
* Use blur my shell extension to add blur effect behind the transparent part of windows
*/
/* Transparent Headerbar */
overlay-split-view revealer.raised.top-bar {
import android.app.AppComponentFactory;
import android.content.pm.ApplicationInfo;
import android.util.Log;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipFile;
@yujincheng08
yujincheng08 / enc_str.cc
Last active June 12, 2025 09:07
Compile time encrypt string
#include "enc_str.h"
#include <cstdio>
static_assert(next_prime<next_prime<4>> == next_prime<4> && next_prime<4> == 5, "??");
static constexpr auto j = "I love vvb2060 and she's my wife."_senc;
static constexpr auto k = ".."_senc;
static constexpr auto l = j + k;
int main() {
@RikkaW
RikkaW / gist:be3fe4178903702c54ec73b2fc1187fe
Last active June 12, 2025 09:07
show window in app_process (impossible to work from Android 14 QPR 3 or Android 15, as addView requires the calling process an Android app process)
token = new Binder();
try {
Context _context = android.app.ActivityThread.systemMain().getSystemContext();
final Context context = new ContextWrapper(_context) {
@Override
public Object getSystemService(String name) {
if (Context.WINDOW_SERVICE.equals(name)) {
WindowManager wm = (WindowManager) super.getSystemService(name);
if (wm != null) {
((android.view.WindowManagerImpl) wm).setDefaultToken(token);
@jgadling
jgadling / main.py
Last active June 12, 2025 09:05
Example of using Strawberry FieldExtensions to implement FastAPI dependency injection in resolvers
# This snippet is valid for older FastAPI versions.
# For an updated DependencyExtension that works with FastAPI 0.115.0, refer to this gist:
# https://gist.github.com/jgadling/bf27a924cd9c34a2a64d2dbf8a5507e6
import typing
import strawberry
import uvicorn
from fastapi import Depends, FastAPI
@shinyquagsire23
shinyquagsire23 / DrawableWrapper.swift
Last active June 12, 2025 09:04
DrawableQueue/LowLevelTexture wrapper class for visionOS 2.0 beta
// Open license, I don't care what you do with this.
// idk how many of these are needed
import SwiftUI
import RealityKit
import Metal
import MetalKit
import Spatial
class DrawableWrapper {
// Caishen SDK Integration Example
// GitHub Repository: https://github.com/CaishenTech/caishen-sdk
//
// This example demonstrates:
// 1. SDK initialization with project key
// 2. Wallet creation for ETHEREUM
// 3. Crypto swap functionality
// 4. Balance checking and token operations
import { CaishenSDK, createAgentTools } from "@caishen/sdk";
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active June 12, 2025 09:02
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for non-video, non-activity quests! For stream/play quests use the desktop app!

Note

When doing stream quests, you need at least 1 other account in the vc!

How to use this script:

  1. Accept a quest under Discover -> Quests
@ingoogni
ingoogni / _iteroscillator.nim
Created June 11, 2025 07:30
Nim closure iterators for audio synthesis.
import math, sugar
import iterit
const
SampleRate {.intdefine.} = 44100
SRate* = SampleRate.float32
proc linOsc*[Tf, Tp: float or iterator:float](