Skip to content

Instantly share code, notes, and snippets.

@itsrobli
itsrobli / macos-airpods.applescript
Created July 29, 2021 23:35
Connects and disconnects from AirPods in macOS Big Sur
# Connects and disconnects from AirPods in macOS Big Sur
# Credit: https://www.reddit.com/r/MacOS/comments/i4czgu/big_sur_airpods_script/gck3gz3/
use framework "IOBluetooth"
use scripting additions
set AirPodsName to "AirPods"
on getFirstMatchingDevice(deviceName)
repeat with device in (current application's IOBluetoothDevice's pairedDevices() as list)
@itsrobli
itsrobli / fork.c
Last active March 14, 2021 13:53
//
// Created by Robert Li on 14/3/21.
//
/*
* Write a program that calls fork(). Before calling fork(), have the main process access a variable (e.g., x) and
* set its value to something (e.g., 100). What value is the variable in the child process? What happens to the
* variable when both the child and parent change the value of x?
*/
#include <stdio.h>

Keybase proof

I hereby claim:

  • I am itsrobli on github.
  • I am robli (https://keybase.io/robli) on keybase.
  • I have a public key whose fingerprint is D13F 9D9F BA11 E0E0 C78A 343A 38C5 06AA FA45 E4D7

To claim this, I am signing this object: