Skip to content

Instantly share code, notes, and snippets.

View NSCabezon's full-sized avatar

Iván Cabezón Orjales NSCabezon

  • Madrid
View GitHub Profile
@mikker
mikker / hide bootcamp partition.sh
Created December 29, 2008 21:47
Hide Bootcamp partition in Mac OS X
# Toggles the hidden flag on the partition. I don't want it visible on my desktop
sudo /Developer/Tools/SetFile -a V /Volumes/BOOTCAMP # or whatever the partitions called
@dhoerl
dhoerl / KeychainItemWrapper.h
Last active April 4, 2023 08:15
KeychainItemWrapper ARCified. Added the ability to manage a dictionary in place of just a string - the #define PASSWORD_USES_DATA in the .m file switches the mode.
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@yvbeek
yvbeek / KeychainItemWrapper.h
Created August 17, 2012 05:32 — forked from dhoerl/KeychainItemWrapper.h
KeychainItemWrapper ARCified
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
@codeswimmer
codeswimmer / ios_simple_pasteboard.m
Created January 2, 2013 20:10
iOS: Simple Usage Of UIPasteBoard
Basically, UIPasteBoard allows us to share data to other application. Below is an example of UIpasteBoard usage.
COPY
UIPasteboard *appPasteBoard = [UIPasteboard generalPasteboard];
appPasteBoard.persistent = YES;
[appPasteBoard setString:@"STRING TO COPY"];
PASTE
@gavrix
gavrix / gist:5054182
Created February 28, 2013 04:28
Script integrating OCLint into XCode. Put it in "Run script" build phase.
source ~/.bash_profile
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
@sonsongithub
sonsongithub / ibhelper.rb
Created July 2, 2013 01:25
Merge script for .strings file generated from Storyboard. ibtool often fails to merge importing .strings file into new generated one.
#!/usr/bin/ruby
require 'optparse'
def main
argv = {}
OptionParser.new do |opt|
opt.on('--previous VALUE') do |v|
argv[:previous] = v
@phildow
phildow / CLLocation+EXIFGPS.h
Last active December 2, 2019 02:37
Category to create GPS metadata dictionary from CLLocation and CLHeading for writing to EXIF data in images.
#import <CoreLocation/CoreLocation.h>
#import <ImageIO/ImageIO.h>
@interface CLLocation (EXIFGPS)
- (NSDictionary*) EXIFMetadataWithHeading:(CLHeading*)heading;
@end
@interface NSDate (EXIFGPS)
@Quotation
Quotation / NSString+XMLSafe.m
Last active November 10, 2017 10:07
Make an XML-safe NSString. Replace invalid XML characters with space.
@implementation NSString (XMLSafe)
- (NSString *)xmlSafeString {
static NSMutableCharacterSet *invalidSet = nil;
if (!invalidSet) {
// XML Character Range definition (http://www.w3.org/TR/2008/REC-xml-20081126/#charsets)
// Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
invalidSet = [[NSMutableCharacterSet characterSetWithRange:NSMakeRange(0x9, 1)] retain];
[invalidSet addCharactersInRange:NSMakeRange(0xA, 1)];
[invalidSet addCharactersInRange:NSMakeRange(0xD, 1)];
@aprato
aprato / AMPNavigationBar.m
Last active July 13, 2018 00:23
Darker iOS7 translucent UINavigationBar
// .h
@interface AMPNavigationBar : UINavigationBar
@property (nonatomic, assign) CGFloat extraColorLayerOpacity UI_APPEARANCE_SELECTOR;
@end
// .m