THIS PROJECT HAS MOVED to an actual repository at https://github.com/nevyn/SPMediaKeyTap.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
xlog = log --graph --pretty=format:\"%C(yellow)%h%Creset %ad %s%C(cyan)%d%Creset %C(green)[%an]%Creset\" --date=short |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
; "git find" should work exactly like your system find (BSD or GNU), except for | |
; two things: one, it will always ignore the current git directory; and two, if | |
; you don't supply any root paths to search, it defaults to searching from your | |
; git project toplevel. | |
; | |
; paul cannon <p@thepaul.org> 2011 | |
find = "!_() { \ | |
declare -a preargs; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can specify the underlying name for a C function the linker/compiler should actually use. If you use an existing | |
function's name, it will just let you refer to it with your prototype's name. If you define the function, it'll give | |
it that name. It even complains if a function of that name already exists. Tested with clang on a Mac, but AFAIK also | |
works in GCC. You can even use special characters in your function names, like you can do in assembly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extend NSWorkspace and add a method to test if the volume is a network mount | |
@implementation NSWorkspace (Extras) | |
- (BOOL)checkForNetworkMountAtPath:(NSString*)path { | |
struct statfs stat; | |
int err = statfs([path fileSystemRepresentation], &stat); | |
if (err == 0) | |
{ | |
return !(stat.f_flags & MNT_LOCAL); | |
} | |
return NO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
| |
echo "You enter a dark dungeon. A sign in front of you says: Choose wisely or you'll probably die." | |
read -p 'staging or production: ' ENV | |
| |
if [ $ENV != "staging" ] && [ $ENV != "production" ] | |
then | |
echo "You go into the wrong hallway, a skeleton comes out and decapitates you. The End." | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2019–20 Adam Sharp and thoughtbot, inc. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
====================================================== | |
THIS CODE IS FOR EDUCATIONAL PURPOSES ONLY. | |
I'M NOT RESPONSIBLE IF YOU SHIP THIS AND IT BLOWS UP IN YOUR FACE. | |
IF IT DOES AND YOU COMPLAIN TO ME I WILL LAUGH AT YOU. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -q -s | |
/* | |
Overly spammy, mostly covered by the other probes (every "read" or "write" is a "request") | |
CFPreferencesServer$target:::request { | |
printf("REQUEST from pid %d at %Y ( domain: %s, user: %s, host: %s, container: %s, managed: %d)\n", arg0, walltimestamp, copyinstr(arg1) != NULL ? copyinstr(arg1) : "(NULL)" ?: "(NULL)", copyinstr(arg2) != NULL ? copyinstr(arg2) : "(NULL)", copyinstr(arg3) != NULL ? copyinstr(arg3) : "(NULL)", copyinstr(arg4) != NULL ? copyinstr(arg4) : "(NULL)", arg5); | |
} | |
*/ | |
CFPreferencesServer$target:::write_rejected { | |
printf("REJECTED WRITE OF KEY %s request from pid %d for reason %s at %Y ( domain: %s, user: %s, host: %s, container: %s)\n", copyinstr(arg1) != NULL ? copyinstr(arg1) : "(NULL)", arg0, copyinstr(arg6) != NULL ? copyinstr(arg6) : "(NULL)", walltimestamp, copyinstr(arg2) != NULL ? copyinstr(arg2) : "(NULL)", copyinstr(arg3) != NULL ? copyinstr(arg3) : "(NULL)", copyinstr(arg4) != NULL ? copyinstr(arg4) : "(NULL)", copyinstr(arg5) != NULL ? copyinstr(arg5) |
OlderNewer