Skip to content

Instantly share code, notes, and snippets.

View juliengdt's full-sized avatar
🎯
Focusing

juliengdt juliengdt

🎯
Focusing
View GitHub Profile
@capttaco
capttaco / Fetchable.swift
Last active May 3, 2019 17:28
A utility protocol for custom NSManagedObjects that makes querying contexts simpler and more convenient. Requires Swift 2.
import CoreData
protocol Fetchable
{
typealias FetchableType: NSManagedObject
static func entityName() -> String
static func objectsInContext(context: NSManagedObjectContext, predicate: NSPredicate?, sortedBy: String?, ascending: Bool) throws -> [FetchableType]
static func singleObjectInContext(context: NSManagedObjectContext, predicate: NSPredicate?, sortedBy: String?, ascending: Bool) throws -> FetchableType?
static func objectCountInContext(context: NSManagedObjectContext, predicate: NSPredicate?) -> Int
@juliengdt
juliengdt / UIViewExtension.swift
Last active August 29, 2015 14:25
ClosureMiniKit
//
// UIViewExtension.swift
// SwiftTester
//
// Created by JulienGdt on 07/07/15.
// Copyright (c) 2015 JulienGdt @jlngdt. All rights reserved.
// @see https://gist.github.com/juliengdt/a80deda0ed2240b4d347
//
import UIKit
@jellybeansoup
jellybeansoup / update-version.sh
Last active June 23, 2021 08:44
Script for Incrementing Version Numbers
#!/bin/bash
# Link: <https://gist.github.com/jellybeansoup/db7b24fb4c7ed44030f4>
#
# A command-line script for incrementing build numbers for all known targets in an Xcode project.
#
# This script has two main goals: firstly, to ensure that all the targets in a project have the
# same CFBundleVersion and CFBundleShortVersionString values. This is because mismatched values
# can cause a warning when submitting to the App Store. Secondly, to ensure that the build number
# is incremented appropriately when git has changes.
#
@skywinder
skywinder / create_fat_framework.sh
Last active October 14, 2018 15:41
Export “fat” Cocoa Touch Framework (for Simulator and Device)
#run this script from Product page in your project Derived Data folder
framework_name="${$(basename $(find ./Debug-iphoneos -type d -name '*.framework' -maxdepth 1))%.*}" && \
cp -R Debug-iphoneos/$framework_name.framework ./$framework_name.framework && \
lipo -create -output "$framework_name.framework/$framework_name" \
"Debug-iphonesimulator/$framework_name.framework/$framework_name" \
"Debug-iphoneos/$framework_name.framework/$framework_name"
@richardbuckle
richardbuckle / make-qa-log.py
Created August 16, 2014 07:35
Format your Git change log into markdown for nightly builds
#! /usr/bin/env python
'''
Format the Git log between current and master into the markdown required for the HockeyApp nightly builds.
'''
import os
import re
ticketRegex = re.compile(r'#(\d+)')
@FrankWu100
FrankWu100 / UIColorFromRGB.m
Last active February 26, 2016 11:50
UIColor macro with hex values
// http://stackoverflow.com/a/3532264
// http://cocoamatic.blogspot.tw/2010/07/uicolor-macro-with-hex-values.html
// http://www.touch-code-magazine.com/web-color-to-uicolor-convertor/
//RGB color macro
#define UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
@FrankWu100
FrankWu100 / FWEncryptorAES.h
Last active March 6, 2023 14:41
AES Encryption/Decryption on Objective-C
//
// FWEncryptorAES.h
// AES Encryptor
//
// Created by FrankWu on 2013/12/20.
// Copyright (c) 2013年 FrankWu. All rights reserved.
//
#import <Foundation/Foundation.h>
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@ryanmaxwell
ryanmaxwell / ryan-objc.cfg
Last active June 26, 2019 16:41
Objective-C Uncrustify Config
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.2 (140)
#
# Alignment
# ---------
## Alignment