Skip to content

Instantly share code, notes, and snippets.

View iltercengiz's full-sized avatar

Ilter Cengiz iltercengiz

View GitHub Profile
@mattt
mattt / uiappearance-selector.md
Last active June 4, 2024 13:28
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' | \
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@altyus
altyus / gist:9916182
Created April 1, 2014 15:12
Facebook Login With ACAccountStore
- (void)facebookLoginWithCompletion:(void (^)(NSString *userID, NSString *email, NSString *fullName))completion
{
self.accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSDictionary *options = @{
ACFacebookAppIdKey:FACEBOOKAPPID,
ACFacebookPermissionsKey: @[@"read_stream", @"basic_info"],
@taylanpince
taylanpince / gist:4ddd7f1b1e20fd0eee23
Created May 6, 2014 15:23
Mark file as "Do Not Backup" in iOS
#include <sys/xattr.h>
const char *filePath = [[storeURL path] fileSystemRepresentation];
const char *attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@soffes
soffes / Array+Each.swift
Created July 17, 2014 19:08
Each on Array in Swift
extension Array {
func each(block: ((Element) -> Void)) {
for i in 0..<count {
block(self[i])
}
}
func eachWithIndex(block: ((Element, Int) -> Void)) {
for i in 0..<count {
block(self[i], i)
@chriseidhof
chriseidhof / parsing.swift
Last active April 16, 2023 02:38
JSON Parsing in Swift
// This code accompanies a blog post: http://chris.eidhof.nl/posts/json-parsing-in-swift.html
//
// As of Beta5, the >>= operator is already defined, so I changed it to >>>=
import Foundation
let parsedJSON : [String:AnyObject] = [
"stat": "ok",
"blogs": [
@bjorgvino
bjorgvino / yosemite ntfs read+write.txt
Last active December 2, 2021 03:58
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
@natecook1000
natecook1000 / Mesozoic.swift
Created November 3, 2014 21:05
Using ObjC-defined NS_OPTIONS in Swift
// objective-c:
typedef NS_OPTIONS(NSInteger, MesozoicPeriod) {
MesozoicPeriodTriassic,
MesozoicPeriodJurassic,
MesozoicPeriodCretaceous
};
// Swift
let period: MesozoicPeriod = MesozoicPeriod.Jurassic
let period2 = MesozoicPeriod.Jurassic | MesozoicPeriod.Cretaceous
@chriseidhof
chriseidhof / LICENSE
Last active July 16, 2019 13:14
A tiny networking library
Copyright 2015 Chris Eidhof
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE