Skip to content

Instantly share code, notes, and snippets.

View canaksoy's full-sized avatar
🎯
Focusing

Can Aksoy canaksoy

🎯
Focusing
View GitHub Profile
@aligundogdu
aligundogdu / gist:2028593
Created March 13, 2012 12:56
Array formatında Türkiye İlleri
$iller[1]="Adana";
$iller[2]="Adıyaman";
$iller[3]="Afyon";
$iller[4]="Ağrı";
$iller[5]="Amasya";
$iller[6]="Ankara";
$iller[7]="Antalya";
$iller[8]="Artvin";
$iller[9]="Aydın";
$iller[10]="Balıkesir";
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active July 17, 2024 10:30
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@RSCdev
RSCdev / config.lua
Created October 1, 2012 15:16 — forked from deanPGM/config.lua
Corona SDK: Config.lua for display options covering all iOS device resolutions.
local targetDevice = ( system.getInfo( "model" ) )
local isTall = ( "iPhone" == system.getInfo( "model" ) ) and ( display.pixelHeight > 960 )
if isTall == false and targetDevice == "iPhone" then
application =
{
content =
{
width = 320,
height = 480,
@yangmeyer
yangmeyer / gist:3840022
Created October 5, 2012 14:17
Setting UIButton titleLabel shadow properties using UIAppearance
[[UIButton appearanceWhenContainedIn:[YMAboutBaseViewController class], nil]
setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
[[UILabel appearanceWhenContainedIn:[UIButton class], [YMAboutBaseViewController class], nil]
setShadowColor:[UIColor clearColor]];
@austinzheng
austinzheng / swiftDelegateExample.swift
Created August 1, 2015 00:12
A simple example of setting up a delegate in Swift.
//
// ExampleCode.swift
//
import UIKit
// MARK: - Protocol
protocol SearchQueryProviderProtocol : class { // 'class' means only class types can implement it
func searchQueryData() -> String
@nazywamsiepawel
nazywamsiepawel / UINavigationBarWithSubtitle.swift
Last active July 20, 2023 11:58
UINavigationBar with subtitle / swift
func setTitle(title:String, subtitle:String) -> UIView {
let titleLabel = UILabel(frame: CGRect(x:0, y:-5, width:0, height:0))
titleLabel.backgroundColor = UIColor.clear
titleLabel.textColor = UIColor.gray
titleLabel.font = UIFont.boldSystemFont(ofSize: 17)
titleLabel.text = title
titleLabel.sizeToFit()
@NatashaTheRobot
NatashaTheRobot / WatchConnectivitySingletonDemo.swift
Last active May 21, 2024 18:21
WatchConnectivity Singleton Demo
//
// WatchSessionManager.swift
// WatchConnectivityDemo
//
// Created by Natasha Murashev on 9/3/15.
// Copyright © 2015 NatashaTheRobot. All rights reserved.
//
import WatchConnectivity
@timonus
timonus / UIWindow+AppSwitchScrollStopper.h
Last active January 6, 2017 19:01
AppSwitchScrollStopper
// UIWindow+AppSwitchScrollStopper.h
// Created by Tim Johnsen on 3/27/16.
#import <UIKit/UIKit.h>
@interface UIWindow (AppSwitchScrollStopper)
/// Call this early on in your app's lifecycle to avoid
/// scroll-related flashing when your app resumes from the background
- (void)installAppSwitchScrollStopper;
@canaksoy
canaksoy / AppDelegate.m
Created April 8, 2016 22:18
ios installed fonts list
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@" %@", name);
}
}
@canaksoy
canaksoy / AppDelegate.m
Last active March 30, 2022 11:09
sha256 hash objective-c ios xcode
-(NSString*)sha256HashFor:(NSString*)input
{
const char* str = [input UTF8String];
unsigned char result[CC_SHA256_DIGEST_LENGTH];
CC_SHA256(str, (CC_LONG)strlen(str), result);
NSMutableString *ret = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH*2];
for(int i = 0; i<CC_SHA256_DIGEST_LENGTH; i++)
{
[ret appendFormat:@"%02x",result[i]];