Skip to content

Instantly share code, notes, and snippets.

@sorbits
sorbits / volumes.cc
Created April 24, 2018 02:15
Get list of browsable volumes
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/ucred.h>
#include <string.h>
#include <vector>
#include <string>
std::vector<std::string> volumes ()
{
std::vector<std::string> res;
### Keybase proof
I hereby claim:
* I am sorbits on github.
* I am sorbits (https://keybase.io/sorbits) on keybase.
* I have a public key ASCRO9t0xfm4YjzZaIbm6yx5y2_lWRfwfKKiIsVCnDEKoAo
To claim this, I am signing this object:
@sorbits
sorbits / gist:64da7bbfb46486d8da66d8f502b4ca30
Created May 27, 2020 05:43
System defined colors (macOS)
textColor
linkColor
textBackgroundColor
labelColor
secondaryLabelColor
tertiaryLabelColor
quaternaryLabelColor
systemBlueColor
@sorbits
sorbits / macos.css
Created May 27, 2020 06:20
CSS variables (and minimal setup) for TextMate web output
:root {
--textColor: rgba(0, 0, 0, 1.00);
--textBackgroundColor: rgba(255, 255, 255, 1.00);
--selectedTextColor: rgba(0, 0, 0, 1.00);
--selectedTextBackgroundColor: rgba(179, 215, 255, 1.00);
--linkColor: rgba(0, 104, 218, 1.00);
--headerTextColor: rgba(0, 0, 0, 0.85);
--labelColor: rgba(0, 0, 0, 0.85);
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/un.h>
int main (int argc, char const* argv[])
{
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
if(fd != -1)
{
char const* socket_path = "/tmp/test.socket";