Skip to content

Instantly share code, notes, and snippets.

View ersentekin's full-sized avatar

Ersen Tekin ersentekin

View GitHub Profile
@ersentekin
ersentekin / TextSizeCalculator.h
Last active August 29, 2015 14:15
TextSizeCalculator which gives you the exact CGSize of the UILabel you should create
#import <Foundation/Foundation.h>
typedef enum kSizeType {
kSizeTypeWidth,
kSizeTypeHeight
} kSizeType ;
@interface TextSizeCalculator : NSObject
+(id)sharedTextSizeCalculator;
@ersentekin
ersentekin / ShadowSherlockActivity.java
Created November 28, 2013 09:28
shadow sherlockActivity to support actionBar methods in Robolectric
import javax.security.auth.spi.LoginModule;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.SpinnerAdapter;
import auth.LoginActivity;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockActivity;
@ersentekin
ersentekin / scrape_turkish_football_league_table.rb
Last active December 21, 2015 02:09
You can scrape (with Mechanize gem) the page to get rivals and time for each match in this season of Turkish SuperToto League :)
def winter_is_coming
post_agent = Mechanize.new
post_page = post_agent.get('http://skorer.milliyet.com.tr/Fikstur?TTName=')
rows = post_page.parser.xpath("id('_MiddleLeft1')/div/table/tbody/tr")
rows.each do |row|
first_team = row.xpath("td[@class='team team1']/text()").to_s