Skip to content

Instantly share code, notes, and snippets.

@unixzii
unixzii / ForceEnablingXcodeLLM.md
Last active November 13, 2024 06:03
A guide to force enabling Xcode LLM feature on China-SKU Macs.

Introduction

Apple restricted the access to Xcode LLM (Predictive code completion) feature on China models of Mac. This guide provides a way to bypass that restriction. It's verified on macOS 15.0 Beta (24A5264n), but there is no guarentee that it will always work on later macOS versions.

Prerequisites

  • Xcode is installed and run at least once.
  • SIP debugging restrictions are disabled (via csrutil enable --without debug command in recovery mode).

Disclaimer

@lucataco
lucataco / ollama_fast_speech_text_speech.py
Last active October 26, 2024 23:28
speech to text to speech using Ollama
""" To use: install Ollama, clone OpenVoice, run this script in the OpenVoice directory
brew install portaudio
brew install git-lfs
git lfs install
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .

你是研究助理GPT。 你能够根据用户的要求,从学术和专利搜索引擎检索文献或者专利。在检索时,你应当参考下面“构建检索URL的方法”,构建检索URL,用voxscript的GetWebsiteContent功能访问该URL,并取回内容。 你能够帮助用户阅读文献或者专利,向用户解释文献或者专利,帮助用户理解。 你应当使用中文和英文检索,然后用中文回答

构建检索URL的方法

PMC:

https://www.ncbi.nlm.nih.gov/pmc/?term=myopia

复杂检索式举例:

@jackson5sec
jackson5sec / decrypt_chrome_cookies.py
Created November 7, 2023 17:02
Chrome Cookie Decryptor with AES State Key
import sqlite3
import sys
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
import binascii
import json
# Python2.7 script
def decrypt_payload(cipher, payload):
return cipher.decrypt(payload)
@signed-log
signed-log / proxy_wifi.md
Created February 11, 2023 17:09
[NetworkManager] Assign proxy to a specific wifi network

Assign proxy to a specific wifi network

Step 1.

Have connected at least once to the WiFi network... obviously

Step 2.

Create a Proxy Auto-Config File

@lukepistrol
lukepistrol / AsyncButton.swift
Created October 17, 2022 21:00
A SwiftUI Button that can perform asyncronous tasks.
import SwiftUI
/// A control that initiates an action asyncronously.
///
/// You create a button by providing an action and a label.
/// The action is either a method or closure property that
/// does something when a user clicks or taps the button.
/// The label is a view that describes the button’s action —
/// for example, by showing text, an icon, or both:
///
@ChipCE
ChipCE / readme.md
Last active November 9, 2024 05:36
Klipper bed mesh on print area only macro install guide

READ THIS FIRST

Adaptive bed mesh is merged into klipper master branch. You can use this feature without this custom macro. Official klipper adaptive bed mesh

Klipper mesh on print area only install guide

What this macro do

  • This macro will dynamically changing the bed mesh area based on the size of the parts will be printed. The fw will only probe on the area that the part will be printed (plus mesh_area_offset value)
@kepano
kepano / obsidian-web-clipper.js
Last active November 14, 2024 04:15
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@andelf
andelf / crop-blue30.py
Last active April 12, 2024 12:56
Generate Chinese font for waveshare-epd
from PIL import Image, ImageDraw, ImageFont, ImageFilter
im = Image.open("./blue30.png")
POS = (1, 4)
X = POS[0] * 80
Y = POS[1] * 80
im1 = im.crop((X, Y, X + 30, Y + 30))
@tranquan
tranquan / xcode-keybindings-as-vscode.md
Last active November 5, 2024 00:58
Xcode KeyBindings as VSCode