Skip to content

Instantly share code, notes, and snippets.

@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@graelo
graelo / README.md
Last active November 15, 2023 13:45
Nvim 0.8 tree-sitter Python conceal

This highlights file should live in <nvim-conf>/after/queries/python/highlights.scm.

Please note that with neovim 0.8, for files which queries extend existing queries, you need to add ; extends at the top of the file (see [this discussion]).

Here is some Python file:

"""Test conceal."""
@expelledboy
expelledboy / uninstall-nix-osx.sh
Last active November 26, 2023 15:53
Trying Nix
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs
@gastonfeng
gastonfeng / 1555826334.txt
Last active December 5, 2023 08:42
PPA 镜像加速
PPA 镜像加速
2018年7月26日 BY : TATERLI
这里有USTC的反向代理.
https://lug.ustc.edu.cn/wiki/mirrors/help/revproxy
只要一句话,全替换成USTC加速的PPA.再也不担心了.
1
sudo find /etc/apt/sources.list.d/ -type f -name "*.list" -exec  sed  -i.bak -r  's#deb(-src)?\s*http(s)?://ppa.launchpad.net#deb\1 http\2://launchpad.proxy.ustclug.org#ig' {} \;
@nicolai86
nicolai86 / gofuncs.go
Created December 15, 2017 05:50
osx sleep/ wake notifications in golang
package main
import (
"C"
"log"
"time"
)
//export CanSleep
func CanSleep() C.int {
@joelouismarino
joelouismarino / googlenet.py
Last active October 9, 2023 07:09
GoogLeNet in Keras
from __future__ import print_function
import imageio
from PIL import Image
import numpy as np
import keras
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, Concatenate, Reshape, Activation
from keras.models import Model
from keras.regularizers import l2
from keras.optimizers import SGD
@twopoint718
twopoint718 / Reader.lhs
Last active April 21, 2024 11:15
An article about the Reader type (functor, applicative, and monad instances)
Okay, so I'll try and walk through the reader monad as best as I can. And
because I think it helps to de-mystify things a bit, I'll also go through
all of the "super classes" of monad: functor and applicative (because every
monad should also be an applicative and every applicative functor should be
a functor). This file is literate Haskell so you should just be able to
load it in the REPL or run it. It's also kinda/sorta markdown, so it should
render that way as well (but the code is formatted wrong).
> module Reader where
anonymous
anonymous / p4merge
Created November 30, 2010 19:50
p4merge script for Mac; to be placed in /usr/local/bin
#!/bin/bash
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/p4merge.app/Contents/Resources/launchp4merge "${absargs[@]}"