Skip to content

Instantly share code, notes, and snippets.

Roman Shevtsov rshev

Block or report user

Report or block rshev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rshev
rshev / sleep_eject
Created Oct 5, 2015
Sleep and remount scripts for use with SD cards on MBPr
View sleep_eject
#!/bin/sh
volumeName="sdextend"
volume=`mount | grep "$volumeName" | sed 's/.*\(disk[0-9]s.\).*/\1/'`
if [ -n "$volume" ]; then
# force quit apps here
/usr/sbin/diskutil unmount force $volume
/usr/sbin/diskutil eject $volume
@rshev
rshev / portrait_with_rotatable_players.swift
Last active Aug 29, 2015
Portrait app with rotatable players
View portrait_with_rotatable_players.swift
//AppDelegate:
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> Int {
var presentedVC = application.keyWindow?.rootViewController
while let pVC = presentedVC?.presentedViewController
{
presentedVC = pVC
}
if let pVC = presentedVC
{
You can’t perform that action at this time.