This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.m | |
// plutilIdent | |
// | |
// Created by Dominik Pich on 08/04/14. | |
// Copyright (c) 2014 Dominik Pich. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILENAME="Localizable.strings" | |
DUPES=`cut -d' ' -f1 "$FILENAME" | sort | uniq -d` | |
while read -r line; do | |
echo "error: $line used multiple times -" | |
done <<< "$DUPES" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#vars | |
if [ "$#" == 0 ]; then | |
ROOT_FOLDER="." | |
else | |
ROOT_FOLDER=$1 | |
fi | |
#we 'assume' only images here and in subfolders | |
IMAGES_FOLDER="./Resources/images/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//got from stackoverflow - quite nice :) | |
//http://stackoverflow.com/questions/8870197/adding-properties-to-uiviewcontroller-and-all-its-subclasses | |
#ifndef ASSOCIATED_STORAGE_PROPERTY_IMP | |
#define THREE_WAY_PASTER_INNER(a, b, c) a ## b ## c | |
#define THREE_WAY_PASTER(x,y,z) THREE_WAY_PASTER_INNER(x,y,z) | |
#define ASSOCIATED_STORAGE_PROPERTY_IMP(type, setter, getter, policy) \ | |
static void * const THREE_WAY_PASTER(__ASSOCIATED_STORAGE_KEY_, getter, __LINE__) = (void*)&THREE_WAY_PASTER(__ASSOCIATED_STORAGE_KEY_, getter,__LINE__); \ | |
\ | |
- (type)getter { return objc_getAssociatedObject(self, THREE_WAY_PASTER(__ASSOCIATED_STORAGE_KEY_, getter,__LINE__) ); } \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "AppleScript Utility" | |
set GUI Scripting enabled to true | |
end tell | |
tell application "iTunes" | |
--get the song | |
set l to playlist "Purchased" | |
set t to item 5 of tracks of l | |
--focus it in list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
@objc | |
class ReflectionHelpers : NSObject { | |
class func getNSNumberForProperty(cls: AnyObject!, name: String!) -> NSNumber! { | |
let m = Mirror(reflecting: cls) | |
let child1 = m.descendant(name) | |
if(child1 != nil) { | |
//bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSAttributedString (DTTextAttachment) | |
+ (instancetype)attributedStringWithTextAttachment:(DTTextAttachment*)attachment { | |
NSMutableDictionary *mAttributes = [NSMutableDictionary dictionary]; | |
[mAttributes setObject:attachment forKey:NSAttachmentAttributeName]; | |
#if DTCORETEXT_SUPPORT_NS_ATTRIBUTES && TARGET_OS_IPHONE | |
// need run delegate for sizing | |
CTRunDelegateRef embeddedObjectRunDelegate = createEmbeddedObjectRunDelegate(attachment); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#config | |
validGitPattern1="@github.com" | |
echoValidRepos=0 | |
#check git paths | |
for path in `ls` | |
do | |
gistfile="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "XMLUtils.h" | |
#import <libxml/xmlreader.h> | |
@implementation XMLUtils | |
//... | |
+ (NSString*)rootNodeNameFromURL:(NSURL*)url { | |
NSString* obj = nil; | |
xmlTextReaderPtr reader = xmlReaderForFile( url.absoluteString.UTF8String, |
OlderNewer