Skip to content

Instantly share code, notes, and snippets.

View chbeer's full-sized avatar

Christian Beer chbeer

View GitHub Profile
@chbeer
chbeer / gist:fe5e66786683786c3b75
Created October 30, 2014 15:55
strings Keys for "Display Pattern" and "Null Placeholder"
"<objectid>.ibShadowedDisplayPattern" = "Localized Text %{value1}@";
"<objectid>.ibShadowedIsNilPlaceholder" = "Null Placeholder i18n";
@chbeer
chbeer / gist:708c696115230a0d7a56
Created October 6, 2014 22:47
Mapping of old OS X date format (as used in strftime) to unicode format (as used nowadays)
OLD NEW
--------------------------------------------------------------------
%A EEEE
%a E
%B MMMM
%b MMM
%C ??
%c ??
%D MM/dd/yy
%d dd

Keybase proof

I hereby claim:

  • I am chbeer on github.
  • I am chbeer (https://keybase.io/chbeer) on keybase.
  • I have a public key whose fingerprint is 955E 7830 DD98 0982 3A8C FC4E 1114 A855 051E 77B4

To claim this, I am signing this object:

#pragma mark -
#pragma mark Core Data stack
/**
Returns the managed object context for the application.
If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application.
*/
- (NSManagedObjectContext *)managedObjectContext {
if (managedObjectContext != nil) {
@chbeer
chbeer / releaseNotes iVocabulary 3.0.3
Last active December 28, 2015 15:39
Release Notes for iVocabulary 3.0.3 (iOS)
- fixes crash when "buy"-cell is removed more than once
- fixes crash by preventing user from "opening" downloading documents
- fixed crash by disabling add button when in magic pages
- fixes crash in multiple choice training when delaying answers
- fixes crash in language edit controller
- fixes crash when adding training mode
- fixes crash when uploading files
- fixes crash in slideshow when going past first word
- fixes crash in training mode when repeating words
- fixes some other crashes
@chbeer
chbeer / simCap_stopRecordingAndSave.scpt
Created November 7, 2013 11:06
AppleScript that sends keystrokes to SimCap.app to stop a running recording and to save the movie to temp.mov
-- Uses System Events' keystrokes to start a recording in SimCap.app
-- SimCap: http://www.jaml.co.uk/simcap/
tell application "SimCap"
activate
tell application "System Events"
tell process "SimCap"
keystroke "r" using {command down}
delay 1.0
keystroke "s" using {command down}
@chbeer
chbeer / simCap_startRecording.scpt
Created November 7, 2013 11:04
AppleScript that sends keystrokes to SimCap.app to start recording of the iOS Simulator screen
-- Uses System Events' keystrokes to start a recording in SimCap.app
tell application "SimCap"
activate
delay 0.5
tell application "System Events"
tell process "SimCap"
keystroke "r" using {command down}
end tell
@chbeer
chbeer / AnimateUILabelTextColor
Created October 2, 2013 09:36
How to animate changing the textColor of a UILabel
[UIView transitionWithView:nameLabel
duration:0.25
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
[nameLabel setTextColor:textColor];
}
completion:nil];
@chbeer
chbeer / storeWindowImageToFile
Last active December 23, 2015 17:29
Stores a screenshot of a window to disk as PNG
@implementation NSWindow (JSTalk)
- (BOOL) storeWindowImageToFile:(NSString*)fileName
{
CGWindowID windowID = (CGWindowID)[self windowNumber];
CGWindowImageOption imageOptions = kCGWindowImageDefault;
CGWindowListOption singleWindowListOptions = kCGWindowListOptionIncludingWindow;
CGRect imageBounds = CGRectNull;
CGImageRef windowImage = CGWindowListCreateImage(imageBounds, singleWindowListOptions, windowID, imageOptions);
@chbeer
chbeer / other c flags
Last active December 21, 2015 17:18
My current "other c flags" setting for get a good amount of warnings and turn the most important/dangerous warnings into errors.
-Wall
-Wno-deprecated-declarations
-Werror=incompatible-pointer-types
-Werror=arc-retain-cycles
-Werror=implicit-function-declaration
-Werror=return-type
-Werror=format
-Werror=mismatched-parameter-types
-Werror=tautological-constant-out-of-range-compare