Skip to content

Instantly share code, notes, and snippets.

@shinvou
shinvou / finwin.fish
Created April 29, 2018 22:35
Fish function to set current working directoy to Finder window path
function finwin --description "Set shell working directory to frontmost Finder window path"
set script "
tell application \"Finder\"
if exists Finder window 1 then
set currentDir to target of Finder window 1 as alias
return POSIX path of currentDir
else
return
end if
end tell"
@shinvou
shinvou / build_xnu.sh
Created December 4, 2017 04:16
Build the macOS High Sierra (10.13.x) xnu kernel.
#!/bin/bash
#
# This is more or less just a bash script for this tutorial: https://0xcc.re/building-xnu-kernel-macosx-sierrra-10-12-x/
# So, huge thanks to Mikal Villa! I updated the tarballs for macOS 10.13 and added line 29.
#
curl -O https://opensource.apple.com/tarballs/dtrace/dtrace-262.tar.gz && \
curl -O https://opensource.apple.com/tarballs/AvailabilityVersions/AvailabilityVersions-32.tar.gz && \
curl -O https://opensource.apple.com/tarballs/libdispatch/libdispatch-913.1.6.tar.gz && \
curl -O https://opensource.apple.com/tarballs/libplatform/libplatform-161.tar.gz
@shinvou
shinvou / Tweak.xm
Created August 20, 2015 06:53
NoBlues
%hook SBApplication
- (BOOL)iconIsRecentlyUpdated:(id)icon
{
// icon is either SBApplicationIcon or SBUserInstalledApplicationIcon, which is a subclass of SBApplicationIcon
return NO;
}
%end
@shinvou
shinvou / Tweak.xm
Last active August 29, 2015 14:27
Submarinated
%hook SBApplication
- (BOOL)iconIsBeta:(id)icon
{
// icon is either SBApplicationIcon or SBUserInstalledApplicationIcon, which is a subclass of SBApplicationIcon
if ([[self bundleIdentifier] isEqualToString:@"com.insanj.submarine"]) return NO;
return %orig;
}
@shinvou
shinvou / RememberThisCode.xm
Created August 18, 2015 14:33
Present notifications that keep in notification center
extern "C" CFTypeRef SecTaskCopyValueForEntitlement(void* task, CFStringRef entitlement, CFErrorRef *error);
static void PresentBannerWithMessageForIdentifier(NSString *message, NSString *identifier, NSDictionary *userInfo)
{
UILocalNotification *notification = [objc_getClass("UILocalNotification") new];
[notification setAlertBody:message];
[notification setUserInfo:userInfo];
//[notification setApplicationIconBadgeNumber:0];
[notification setHasAction:YES];
[notification setAlertAction:nil];