Skip to content

Instantly share code, notes, and snippets.

View crossle's full-sized avatar
🌐

Crossle Song crossle

🌐
View GitHub Profile
@crossle
crossle / DoubleTouchScrollView
Created January 17, 2013 08:31
ScrollView contain a TextView who had a scrollbar
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ScrollView;
public class CustScrollView extends ScrollView {
public CustScrollView(Context context) {
super(context);
}
@crossle
crossle / clear_log.rb
Last active December 11, 2015 04:28
Clear Rail log in development env only cp it to Rails.root/config/initializers/
if Rails.env.development?
MAX_LOG_SIZE = 10.megabytes
logs = [File.join(Rails.root, 'log', 'development.log'), File.join(Rails.root, 'log', 'test.log')]
logs.each do |log|
if File.size?(log).to_i > MAX_LOG_SIZE
$stdout.puts "Remove Log: #{log}"
`rm #{log}`
end
end