Skip to content

Instantly share code, notes, and snippets.

View sanekgusev's full-sized avatar

Aleksandr Gusev sanekgusev

View GitHub Profile
@sanekgusev
sanekgusev / gist:151fa8688be0dd9dc351497b4fd1016f
Created May 20, 2016 08:00
Disable Photos.app opening for every connected device
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
@sanekgusev
sanekgusev / gist:305e88d9bf642387a0abc81d804d3aa0
Created May 18, 2016 18:37
Show crash report dialogs as desktop notifications
defaults write com.apple.CrashReporter UseUNC 1
@sanekgusev
sanekgusev / osx-for-hackers.sh
Last active June 8, 2016 07:16 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@sanekgusev
sanekgusev / gist:8b28a52f9569315648b5
Created February 21, 2016 18:05
Create Caskfile from the list of installed casks
brew cask list | sed 's/^/cask install /' > Caskfile
@sanekgusev
sanekgusev / gist:8b4c74c94af57221cdf7
Created February 21, 2016 18:04
Remove iTunes for good
sudo rm -rf /Applications/iTunes.app \
sudo softwareupdate --ignore iTunesX
@sanekgusev
sanekgusev / gist:bb7a28041e3caf1e52dd
Created February 21, 2016 18:01
List all installed Mac App Store apps
find /Applications \
-path '*Contents/_MASReceipt/receipt' \
-maxdepth 4 -print |\
sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##'
@sanekgusev
sanekgusev / gist:2380abd5798f2b5d7d28
Created May 12, 2015 13:38
dispatch_semaphore + NSBlockOperation
- (void)runAsyncOperationWithStartBlock:(void (^)(dispatch_block_t asyncOperationCompletionBlock))startBlock {
NSCParameterAssert(startBlock);
if (!startBlock) {
return;
}
NSOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
dispatch_semaphore_t completionSemaphore = dispatch_semaphore_create(0);
startBlock(^{
dispatch_semaphore_signal(completionSemaphore);
});