Skip to content

Instantly share code, notes, and snippets.

View atermenji's full-sized avatar

Artur Termenji atermenji

View GitHub Profile
@xian
xian / 00_README.md
Last active December 14, 2015 07:48 — forked from JakeWharton/ActionBarSherlockRobolectric.java
Here's the magic to get ActionBarSherlock working with Robolectric 2.0-alpha-2!

You need to add the files below, and do this once in your base test runner:

ActionBarSherlock.registerImplementation(ActionBarSherlockRobolectric.class);
ActionBarSherlock.unregisterImplementation(ActionBarSherlockNative.class);
ActionBarSherlock.unregisterImplementation(ActionBarSherlockCompat.class);
@chrisbanes
chrisbanes / gist:5004907
Last active January 24, 2021 01:13
Blocking ListView
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;
public class BlockingListView extends ListView {
private boolean mBlockLayoutChildren;
public BlockingListView(Context context) {
super(context);
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@JakeWharton
JakeWharton / README.md
Last active October 13, 2015 14:38
Maven pom for Google Play services
@jgilfelt
jgilfelt / ScaleFadePageTransformer.java
Created December 3, 2012 20:05
An ICS+ app/widget drawer style PageTransformer for your ViewPager
/***
* Copyright (c) 2012 readyState Software Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@roman-mazur
roman-mazur / AnimatedCrossDrawable.java
Created December 3, 2012 13:26
Code examples used at "Fine-tuning Android apps" talk: http://goo.gl/1fV7T
package com.example.testtest;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.Shader;
@cyrilmottier
cyrilmottier / LicensesActivity.java
Created November 21, 2012 11:10
"Open source licenses" screen
package com.cyrilmottier.android.citybikes;
import android.os.Bundle;
import com.cyrilmottier.android.avelov.R;
import com.cyrilmottier.android.citybikes.app.BaseActivity;
public class LicensesActivity extends BaseActivity {
private WebView mWebView;
@skyriverbend
skyriverbend / rails_switch_branch.py
Created November 15, 2012 05:54
Rails: Switch branches and run migrations
#!/usr/local/bin/python
"""
To use this script, you must be in the root directory of a Rails project that
is using git. You should also make sure that your directory does not contain any
uncommitted changes. Then run:
$ python rails_switch_branch.py name_of_another_branch
Running the above will do the following:
@AlexDenisov
AlexDenisov / svn_aliases.sh
Created November 6, 2012 11:54
Useful aliases for SVN
alias subadd="svn st | grep '^?' | sed 's/^? *\(.*\)/\"\1\"/g' | sed 's/@\(.*\)/@\1@/g' | xargs svn add"
alias subrm="svn st | grep '^!' | sed 's/^! *\(.*\)/\"\1\"/g' | sed 's/@\(.*\)/@\1@/g' | xargs svn rm"
alias subst='svn st'
alias subci='svn ci'
alias subup='svn up'
@TomTasche
TomTasche / feedback_android.java
Created October 21, 2012 12:22
Use built-in feedback mechanism on Android
// more information here: http://blog.tomtasche.at/2012/10/use-built-in-feedback-mechanism-on.html
try {
int i = 3 / 0;
} catch (Exception e) {
ApplicationErrorReport report = new ApplicationErrorReport();
report.packageName = report.processName = getApplication()
.getPackageName();
report.time = System.currentTimeMillis();
report.type = ApplicationErrorReport.TYPE_CRASH;