Skip to content

Instantly share code, notes, and snippets.

View Blackjacx's full-sized avatar
👨‍💻
Coding

Stefan Herold Blackjacx

👨‍💻
Coding
View GitHub Profile
@Blackjacx
Blackjacx / LoadingHTMLResourceIntoWebView
Created May 15, 2013 15:04
Loading HTML Resource Into UIWebView
- (void)showHTMLRessourceInWebView:(BOOL)animated
{
// Load html data from main bundle
NSString * filePath = [[NSBundle mainBundle]
pathForResource:@"<RESOURCE_NAME>"
ofType:@"html"];
NSData * htmlData = [NSData dataWithContentsOfFile:filePath];
if( !htmlData ) {
@Blackjacx
Blackjacx / gist:7c51ece9a6ba513ec23c
Last active August 29, 2015 14:12
Core Data Managed Object Creation using Magical Record
/*
Create a temporary context with the default context as parent.
The state of the default context will be available in the temporary context.
If you are really sure you want to save the object you don't need to create a temporary context.
You can use MR_defaultContext in this case.
*/
NSManagedObjectContext *tempContext = [NSManagedObjectContext MR_contextWithParent:[NSManagedObjectContext MR_defaultContext]];
/*
Perform operations on the temporary context on the
@Blackjacx
Blackjacx / SoftwareStack.md
Last active May 9, 2019 21:24
My Apple Software Stack
@Blackjacx
Blackjacx / Backup_Items_Mac.md
Last active August 29, 2015 14:16
What you should backup on a mac when you need to switch devices

Backup that when moving to a new Mac

Item to Backup What is This?!
iMessage History Find it in ~/Library/Messages/. Remember to check the file ownership of that folder.
Developer Profile Your accounts set up in Xcode including your code signing identities and provisioning profiles.

Xcode > Preferences > Accounts > Lower Left Settings Gear > Export Accounts...
1Password Vaults All the stored passwords.
Mail History All E-Mails.
~/.ssh public and private key pairs including ssh config file
~/.bash_profile If you are using bash and have configured it for convenience.

How to do codereview

Step 1: Context

Check what should have been done

Step 2: Git Changes

Check the related git commit

Step 3: Syntax Check

Check if the Dev use the right syntax and follow the styleguide

@Blackjacx
Blackjacx / installLinuxSoftwareStack.sh
Last active August 29, 2015 14:17
Install Linux Software Stack
## add keyring
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com <key>
## add: alternative keyserver
sudo apt-key adv --keyserver keys.gnupg.net --recv-keys <key>
## chrome: manually from http://www.google.com/chrome/eula.html
## skype: manually from http://www.skype.com/download/skype/linux/
sudo apt-get install filezilla libxvidcore4 gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-ffmpeg gstreamer0.10-pitfdll libquicktime1 libxine1-plugins w32codecs libdvdread4 pidgin pidgin-facebookchat pidgin-hotkeys pidgin-libnotify pidgin-musictracker pidgin-plugin-pack pidgin-themes pidgin-sipe chmsee breathe-icon-theme dia googleearth miro rednotebook specto ubuntu-restricted-extras zim mplayer inkscape p7zip-full apt-show-versions libdvdcss vobcopy keepassx acroread tvtime wbar ubuntu-tweak texmaker vlc isomaster openssh-client openssh-server vim lsdvd une
@Blackjacx
Blackjacx / Unix_Commands.txt
Created March 16, 2015 21:54
Unix Commands
### system ###
# Disc Space Usage
df -h
# Folder size
du -sh <folder_name>
# Process Information
top
@Blackjacx
Blackjacx / Different_Ways_of_statusbarHeight.m
Last active August 29, 2015 14:23
Different Ways of statusbarHeight
CGFloat statusBarHeight = CGRectGetMaxY([self.view.window convertRect:UIApplication.sharedApplication.statusBarFrame toView:self.view]);
#define kStatusBarHeight [self.window convertRect:UIApplication.sharedApplication.statusBarFrame toView:self].size.height
- (CGFloat)AT_statusBarHeight
{
CGFloat statusBarHeight = 0.f;
@Blackjacx
Blackjacx / annotateAppIcon.sh
Created October 2, 2015 00:48
App Icon Annotation (version, build number, etc)
# check if tools installed
if ! type "composite" > /dev/null; then
exit 0
fi
IFS=$'\n'
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
versionNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}")
PATH=${PATH}:/usr/local/bin
TARGET_PATH=${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}
@Blackjacx
Blackjacx / gist:19351019cf5d76ffc718
Created October 12, 2015 12:38
iOS_performActionAfterSystemAnimation
[CATransaction begin];
[CATransaction setCompletionBlock: ^{
[...];
[...];
}];
// Do the animated table view stuff
[CATransaction commit];