Skip to content

Instantly share code, notes, and snippets.

View LeaveNhA's full-sized avatar
👨‍🏫
Yüksek bir ideal için çalış!

Seç LeaveNhA

👨‍🏫
Yüksek bir ideal için çalış!
View GitHub Profile
@LeaveNhA
LeaveNhA / main.md
Created August 8, 2026 15:36
kdebug Class MACH Definitions

Codes for the macOS scheduler's DBG_MACH_SCHED subclass (kdebug class MACH, subclass 0x40) aren't documented anywhere on the web even an LLM couldn't find it after a try-hard session, despite showing up constantly in Instruments' Thread State Trace and raw kdebug captures. This table is a plain transcription of the definitions in sys/kdebug.h as shipped in the Xcode/macOS SDK, and part of Apple's XNU kernel sources released under the Apple Public Source License 2.0.

Local path in my environment and probably in yours too (as of today, because you know, apple...): /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kdebug.h Current upstream source: github.com/apple-oss-distributions/xnu

I sincerely wanted to let the web have it publicly and search engines index it because sometimes it is really hard to find what we are looking for in 'the mess we are in'.

Also, still surprised why even with the quoted search, google didn't bring the original file

@LeaveNhA
LeaveNhA / donts.clj
Last active July 24, 2026 18:59
Some Clojure don't-s
# abusing partials and almost intentionally avoding named parameters won't make your code more functional.
(fn [xs n] ((comp (partial reduce (partial apply conj) []) (partial map (partial apply drop-last)) (partial map (comp #(
update % 0 (fn [p] (- p (- n 1)))) (juxt count identity))) (partial apply partition-all) reverse vector) xs n))
# if you think list processing isn't in the nature of the language, you have to see a professional.
(comp (partial apply map vector) (partial apply partition-all) reverse vector)
# lisp family languages can show-off enough for you, stop doing fancy things.
(fn [n xs]
(take (count xs)
@LeaveNhA
LeaveNhA / khanacademy.org.css
Created June 26, 2026 03:00
KhanAcademy.org Dark Mode, CSS, injection-ready
/* ============================================================================
KHAN ACADEMY: HIGH-FIDELITY DARK MODE INJECTION
--------------------------------------------------------------------------
Design Philosophy: Declarative structural mapping, reduced luminance
spikes, and micro-contrast optimization for long-form reading comfort.
============================================================================ */
@media (prefers-color-scheme: dark) {
/* ==========================================================================
{
"swagger": "2.0",
"x-id": [
"default"
],
"paths": {
"/math/plus": {
"get": {
"responses": {
"200": {
We can't make this file beautiful and searchable because it's too large.
question_id,bundle_id,explanation_id,correct_answer,part,tags,deployed_at
q1,b1,e1,b,1,1;2;179;181,1558093217098
q2,b2,e2,a,1,15;2;182,1558093219720
q3,b3,e3,b,1,14;2;179;183,1558093222784
q4,b4,e4,b,1,9;2;179;184,1558093225357
q5,b5,e5,c,1,8;2;179;181,1558093228439
q6,b6,e6,d,1,9;2;179;182,1558093231307
q7,b7,e7,d,1,11;7;179;183,1558093233992
q8,b8,e8,b,1,20;21;179;184,1558093236876
q9,b9,e9,c,1,13;2;179;183,1558093239849
@LeaveNhA
LeaveNhA / why_people_letting_python_be_a_major_languıage_questionmark.py
Created July 13, 2022 23:06
In Python, you can merge two nested dicts or apply functions over them even if them nested, yes!
def apply_with(d, fn=lambda x: x):
res = d.copy() # "= dict(d1)" for lists of tuples
for key, val in res.items():
if type(res[key]) is dict:
res[key] = apply_with(res[key], fn)
else:
res[key] = fn(res[key])
return res
def merge_with(d1, d2, fn=lambda x, y: x + y):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LeaveNhA
LeaveNhA / OMUerfi.sh
Last active June 22, 2022 12:19
OMÜ Exam Result Fetcher and Informer!
# Go and login on UBS.
# Use your browser's development tools to get the
# NET_SessionId cookie information.
# Place the information in '!!!' part of the code.
# Run the code on MacOS as it is or replace "say"
# call with something else like ringing the shell or etc.
$LOGINSECRET=!!! watch -n 10 'if [[ $(http https://ubs.omu.edu.tr/Ogrenci/Ogr0201/Default.aspx\?lang\=tr-TR Cookie:ASP.NET_SessionId=$LOGINSECRET |grep "_tdBn" |egrep -o ">[0-9]+<" |cut -c 2-3 |wc -w |egrep -o "[0-9]+") == "10" ]]; then
say "Congrats\! The exams results are online\!"
else
@LeaveNhA
LeaveNhA / UIST624 - GLM, HW.ipynb
Created June 9, 2022 18:15
Homework, postgrad UIST624, OMU - Data Science
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
YAS BOY KILO KOLESTROL SIGARA KAN_GRUBU SONUC
60 176 87 395 EVET B POSITIF
53 167 86 350 EVET o POSITIF
64 170 100 304 EVET A POSITIF
37 173 79 178 HAYIR o NEGATIF
26 170 81 206 HAYIR o NEGATIF
61 165 92 284 EVET o POSITIF
39 174 95 232 HAYIR o NEGATIF
28 171 68 252 PASIF A POSITIF
33 180 90 359 EVET A POSITIF