Skip to content

Instantly share code, notes, and snippets.

@creativepsyco
creativepsyco / HighlightRadioButton.java
Created October 4, 2013 06:02
HighlightRadionButton with two state list drawable
public class HighlightedImageRadioButton extends RadioButton {
private Drawable buttonDrawable;
public HighlightedImageRadioButton(Context context) {
super(context);
}
@pboos
pboos / annotation-processor-build.gradle
Last active August 7, 2020 06:38
Gradle stuff for Android
configurations {
apt
}
dependencies {
compile 'com.squareup.dagger:dagger:1.1.0'
apt 'com.squareup.dagger:dagger-compiler:1.1.0'
}
android.applicationVariants.all { variant ->
@creativepsyco
creativepsyco / install_key.sh
Created February 8, 2013 10:46
Deploy Scripts (FASTCGI)
#!/bin/bash
set -ef
domain="YOUR_DOMAIN"
module="key"
wwwdir="/var/www"
rootdir=$wwwdir/$domain
staticdir=$rootdir/static
cgidir=$rootdir/fastcgi
@olistik
olistik / gist:2627011
Last active August 12, 2021 06:39
Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)

Basic pre-requisites

  • Some utilities:
sudo apt-get install vim tmux git curl
  • Copy/paste from the command line:
@slok
slok / create_github_bitbucket_mirror.md
Created December 8, 2011 11:30
Create github and bitbucket mirror in gitolite

Create Github/Bitbucket Mirror

Create SSH key and configure

Create Key (no passphrase and name mirror the key)

ssh-keygen -t rsa -N "" -f ~/.ssh/mirror
@marshall
marshall / ClassLoaderActivity.java
Created February 22, 2011 17:16
A reflection hack to override the APK ClassLoader so you can launch Activities in an external JAR.
//
// !!WARNING: Not recommended for production code!!
//
public class ClassLoaderActivity extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
// file.jar has a dex'd "classes.dex" entry that you can generate with "dx" from any number of JARs or class files
ClassLoader dexLoader = new DexClassLoader("/path/to/file.jar", getCacheDir().getAbsolutePath(), null, getClassLoader());
setAPKClassLoader(dexLoader);