Skip to content

Instantly share code, notes, and snippets.

Simone Manganelli simX

Block or report user

Report or block simX

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
View gist:74991bdb71233a261e5cc96db0935118
func testReservationListPositions() {
let moc = CoreDataStack.sharedStack().mainObjectContext
let reservationListVC = ReservationListViewController()
do {
let reservation1 = try ReservationFactory.generateWithTemplate(ReservationFactory.Template(), parentContext: moc)
} catch {
simX / export_notes
Created Mar 14, 2013
Quick AppleScript to export all your notes from Apple's built-in application
View export_notes
tell application "Notes"
set note_body_list to (get body of every note)
end tell
set note_count to (count of note_body_list)
set blah_folder to choose folder
set blah_path to POSIX path of blah_folder
repeat with i from 1 to note_count
set filename_string to ((blah_path & "note" & (i as string) & ".html") as text)
simX / hidpi.txt
Created Jul 28, 2012
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
View hidpi.txt
sudo defaults write /Library/Preferences/ DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/ DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
simX / addcontact
Created Feb 10, 2012
Add contact command line program
View addcontact
osascript -e "tell application \"Address Book\"" \
-e " set firstParam to \"$1\"" \
-e " set secondParam to \"$2\"" \
-e " set thirdParam to \"$3\"" \
-e " set fourthParam to \"$4\"" \
-e " set contactEmailLabel to \"\"" \
-e " set spaceOffset to (offset of \" \" in firstParam)" \
-e " if (spaceOffset is not equal to 0) then" \
-e " set AppleScript's text item delimiters to \" \"" \
simX / gist:1368554
Created Nov 15, 2011
Full build log
View gist:1368554
CompileC "build/ Store Debug/Tagalicious for Mac App" IPSmartPlaylist.m normal x86_64 objective-c
cd "/Volumes/Macintosh HD/Users/simmy/Development/tagalicious"
setenv LANG en_US.US-ASCII
/Developer/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id
-fdiagnostics-parseable-fixits -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter
-Wunused-variable -Wunused-value -Wuninitialized -Wno-shorten-64-to-32 -DDEBUG=1 -DAPPSTORE=1 -isysroot /Developer/SDKs/MacOSX10.7.sdk -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -fvisibility=hidden -Wno-sign-conversion "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)"
-iquote "/Volumes/Macintosh HD
You can’t perform that action at this time.