Skip to content

Instantly share code, notes, and snippets.

View toms972's full-sized avatar

Tom Susel toms972

  • Israel
View GitHub Profile
@toms972
toms972 / count_android_methods.rb
Created July 28, 2014 09:05
Android environment has a limitation of maximum 65536 methods definition Here is a ruby script that helps to count the number of methods per each jar.
#!/usr/bin/env ruby
class CountAndroidMethods
def count(path)
full_folder_path = File.expand_path(path)
total_count = 0
# Traverse the folder
Dir.entries(full_folder_path).each {|file|
@toms972
toms972 / IcyClientConnManager
Created February 6, 2014 11:07
As of Android OS 4.4, HttpURLConnection fails to parse non standard HTTP headers. Here is a workaround based on the Stackoverflow discussion here: http://stackoverflow.com/questions/19759966/how-to-parse-a-none-standard-http-response
package com.myapplication.utils.network;
import org.apache.http.conn.ClientConnectionOperator;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.impl.conn.SingleClientConnManager;
import org.apache.http.params.HttpParams;
/**
* User: tom
* Date: 2/6/14
@toms972
toms972 / UITextView+VerticalAlignment.h
Last active June 2, 2017 11:18
Example of vertical alignment for UITextView content.Implemented as a category over UITextView.The reason to choose a category over subclassing is so that legacy code could be easily tweaked.This hack was inspired by the following blog post: http://www.macbaszii.com/2012/10/ios-dev-uitextview-vertical-alignment.html?q=vertical
//
// UITextView+VerticalAlignment.h
// VerbalShoppingList
//
// Created by Tom Susel on 1/9/14.
//
#import <UIKit/UIKit.h>
@interface UITextView (VerticalAlignment)
package com.tom.utils;
import android.os.Environment;
import android.os.StatFs;
/**
* Created by Tom on 7/15/13.
* Some helper methods for FS queries.
*/
public class DiskUtils {