Skip to content

Instantly share code, notes, and snippets.

@zhuowei
zhuowei / Ensemble.plist
Last active September 18, 2023 06:26
Put this file as /Library/Preferences/FeatureFlags/Domain/Ensemble.plist and reboot to (hopefully) turn on Universal Control on macOS 12
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- not sure which one it is, so set both -->
<key>Ensemble</key>
<dict>
<key>Enabled</key>
<true/>
</dict>
@iamandrewluca
iamandrewluca / bookmarks-to-notion.js
Last active April 17, 2024 10:18
Export bookmarks to Notion as a Database
(function bookmarksExportToCsv() {
/**
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks
*/
@bbqtd
bbqtd / macos-tmux-256color.md
Last active April 24, 2024 01:28
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@dvf
dvf / change-codec.md
Last active May 1, 2024 19:52
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@mag911
mag911 / Parallel_Tools_fix_for_Ubuntu_19.04.md
Last active July 14, 2023 20:56
Parallel Tools fix for Ubuntu 20.04, 19.04, 19.10, 18.04

Update 25 April 2020:

Many thanks to @KZL1992 @tomslominski @ptrofi @n-thumann for recent comments on their experiences with 20.04 and Parallels 13/14/15, especially the subsitution of the latest prl-tools-lin.iso for older Parallels to get it going.


First off, credit goes to github.com/rudolfratusinski for leading the way here.

https://gist.github.com/rudolfratusinski/a4d9e3caff11a4d9d81d2e84abc9afbf

@trmaphi
trmaphi / changeJDK.bash
Last active April 5, 2024 04:06
[Change system wide java version on Mac OS] Inspire by a stackoverflow answer https://stackoverflow.com/a/44169445/6730571 #bash #mac
#!/usr/bin/env bash
JDKS_DIR="/Library/Java/JavaVirtualMachines"
JDKS=( $(ls ${JDKS_DIR}) )
JDKS_STATES=()
# Map state of JDK
for (( i = 0; i < ${#JDKS[@]}; i++ )); do
if [[ -f "${JDKS_DIR}/${JDKS[$i]}/Contents/Info.plist" ]]; then
JDKS_STATES[${i}]=enable
@munificent
munificent / generate.c
Last active May 1, 2024 20:06
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shoogle
shoogle / qt-without-xcode.md
Last active April 30, 2024 16:45
Qt without XCode - how to use Qt Creator for macOS software development without installing XCode

Qt without Xcode

How to use Qt Creator for software development on macOS without having to install Xcode

Justification

Qt refuses to install on macOS unless Apple's Xcode is installed beforehand. This is unfortunate because:

@zurk
zurk / Bblfsh usecases.ipynb
Last active December 21, 2017 13:06
Bblfsh usecases
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.