Skip to content

Instantly share code, notes, and snippets.

View Artoria2e5's full-sized avatar
🌪️
not focusing!

Mingye Wang Artoria2e5

🌪️
not focusing!
View GitHub Profile
@unixzii
unixzii / ForceEnablingXcodeLLM.md
Last active July 22, 2024 11:16
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

@williamyang98
williamyang98 / calculate_horner_polynomial_gradient_descent.cpp
Last active May 29, 2024 00:42
Calculate chebyshev polynomial that will approximate f(x) = sin(kx). where k = π/root. Uses gradient descent.
// Compiling with clang or gcc
// clang main.cpp -o main -march=native -O3 -ffast-math -Wextra -Werror -Wunused-parameter -lm
// Use "-march=native -ffast-math -O3" for faster gradient descent
// Use "-lm" if linking to glibc math libraries on Linux
// Remove "-W*" warning flags if you don't need checks
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <cmath>
#include <vector>
@stek29
stek29 / extract_telegram_macos.ipynb
Last active July 7, 2024 11:43
Extract Telegram messages from db_sqlite PostBox – made for Telegram for macOS, but should work with Telegram for iOS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rjeczalik
rjeczalik / how-to-find-forks-of-deleted-repo.md
Created August 26, 2019 16:39
How to find forks of a deleted repository?
@rnapier
rnapier / fix-xcode
Last active March 18, 2022 01:17
Links Xcode SDKs from the /SDKs directory (which you maintain yourself)
#!/usr/bin/python
# fix-xcode
# Rob Napier <robnapier@gmail.com>
# Script to link in all your old SDKs every time you upgrade Xcode
# Create a directory called /SDKs (or modify source_path).
# Under it, put all the platform directories:
# MacOSX.platform iPhoneOS.platform iPhoneSimulator.platform
# Under those, store the SDKs:
@luisparravicini
luisparravicini / DumpIndex.java
Created October 12, 2009 14:40
Dumps a Lucene index as a XML document.
import java.io.File;
import java.io.IOException;
import java.util.List;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import org.apache.lucene.document.Document;