Skip to content

Instantly share code, notes, and snippets.

View TimurAykutYildirim's full-sized avatar

Timur Aykut YILDIRIM TimurAykutYildirim

View GitHub Profile
@TimurAykutYildirim
TimurAykutYildirim / ClassGetSubclasses.m
Created March 5, 2018 08:18 — forked from d4rkl1gh7/ClassGetSubclasses.m
Get All Subclasses of Objective-C (Cocoa) Class
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <objc/objc-runtime.h>
NSArray *ClassGetSubclasses(Class parentClass) {
int numClasses = objc_getClassList(NULL, 0);
Class *classes = NULL;
classes = malloc(sizeof(Class) * numClasses);
numClasses = objc_getClassList(classes, numClasses);
@TimurAykutYildirim
TimurAykutYildirim / getCommitDates.py
Last active December 12, 2017 11:02
Get latest commit dates of every files in a git repository
#!/usr/bin/env python
# vim:fileencoding=utf-8:ft=python
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# Last modified: 2015-05-24 12:28:45 +0200
#
# To the extent possible under law, Roland Smith has waived all
# copyright and related or neighboring rights to gitdates.py. This
# work is published from the Netherlands. See
# http://creativecommons.org/publicdomain/zero/1.0/
@TimurAykutYildirim
TimurAykutYildirim / pointSize_change_xib_storyboard.sh
Created November 29, 2017 05:35
script for increase/decrease of value in pointSize property from all storyboards and xibs in a project
find . -type f -name '*xib' -o -name '*storyboard' -print0 | xargs -0 perl -pi.back -e 's/pointSize=\"(\d+)/"pointSize=\"" . ($1 + 1)/ge'
@TimurAykutYildirim
TimurAykutYildirim / removeAndroidSDK.sh
Created November 29, 2017 05:31
script for complete uninstall of android studio and android sdk
# source : https://stackoverflow.com/a/18458893/1450201
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm -Rf ~/Library/Preferences/com.google.android.*
rm -Rf ~/Library/Preferences/com.android.*
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
@TimurAykutYildirim
TimurAykutYildirim / .swift
Created November 13, 2017 12:01
How to list fonts in an iOS project with Swift
/*
Add following loop somewhere in your view.
It will list all the fonts and type names (which you need to write properly or app will crash)
In my case, i did presume like this:
#define FONT_LIGHT @"SF-Pro-Text-Light"
#define FONT_REGULAR @"SF-Pro-Text-Regular"
#define FONT_MEDIUM @"SF-Pro-Text-Medium"
#define FONT_BOLD @"SF-Pro-Text-Bold"
#define FONT_BLACK @"SF-Pro-Text-Heavy"
@TimurAykutYildirim
TimurAykutYildirim / .m
Last active May 20, 2019 06:39
How to list fonts in an iOS project with Objective-C
/*
Add following loop somewhere in your view.
It will list all the fonts and type names (which you need to write properly or app will crash)
In my case, i did presume like this:
#define FONT_LIGHT @"SF-Pro-Text-Light"
#define FONT_REGULAR @"SF-Pro-Text-Regular"
#define FONT_MEDIUM @"SF-Pro-Text-Medium"
#define FONT_BOLD @"SF-Pro-Text-Bold"
#define FONT_BLACK @"SF-Pro-Text-Heavy"
@TimurAykutYildirim
TimurAykutYildirim / introrx.md
Created February 1, 2017 15:03 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@TimurAykutYildirim
TimurAykutYildirim / README.md
Created November 4, 2016 11:45 — forked from nicerobot/README.md
Mac OS X uninstall script for packaged install of node.js

To run this, you can try:

curl -ks https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh

@TimurAykutYildirim
TimurAykutYildirim / sampleAfnetworkingRequest.m
Created November 1, 2016 07:04
Simple objective-c code for http request with AFNetworking. It supports versions 3.0+
- (void) makeRequest {
NSString *link = @"https://www.google.com";
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager GET:link parameters:nil progress:nil success:^(NSURLSessionTask *task, NSDictionary* responseObject) {
//NSLog(@"JSON: %@", responseObject);
for (id key in responseObject) {
NSLog(@"OBJECT: %@", [responseObject objectForKey:myObjectName]);
}
@TimurAykutYildirim
TimurAykutYildirim / search.py
Last active November 13, 2017 12:02
small python script for searching string within all files of any directory. Should work just fine in any *nix systems
import os
import subprocess
myString = str(raw_input('search key: '))
print myString
myCommand= 'grep -rl "' + myString +'" /Users/timur/Desktop/ems'
print myCommand
os.system(myCommand)
#result = subprocess.check_output([command])
#subprocess.Popen(command)