Skip to content

Instantly share code, notes, and snippets.

View scruffyfox's full-sized avatar
🏳️‍🌈
+++

ScruffyFox scruffyfox

🏳️‍🌈
+++
View GitHub Profile
public class Holla
{
public static Holla hola()
{
return new Holla();
}
private Holla(){}
public $ get$()
@scruffyfox
scruffyfox / Card UI
Last active August 29, 2015 13:57
Card drawable
Basic card layout with drawables and styles.
Missing icons: ic_action_remove, ic_action_accept and ic_action_cancel (all can be found in the standard android icon pack)
Example screenshot: https://pbs.twimg.com/media/BmTdvKhIYAAkrPa.png
import java.util.regex.Pattern
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
@scruffyfox
scruffyfox / SQLiteManager.java
Created December 13, 2013 12:09
SQLite example
package com.cube.arc.lib.manager;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.cube.arc.model.Pet;
import com.cube.arc.pfa.R;
@scruffyfox
scruffyfox / Structure.md
Last active December 30, 2015 04:09
Documentation of default coding style for 3SC

#README

This is the default struture of all projects (starting from Jan 2013) for 3 SIDED CUBE.

Last updated: 11/07/14 by Callum Taylor

Note: These guidelines are for everyone's benifit, to ensure consistency between code and projects, allowing quick understanding of the code with minimal problems.

##Structure

@scruffyfox
scruffyfox / translator.java
Created December 2, 2013 16:55
Converts a spreadsheet into string resources
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
public class main
{
public static void main(String[] args)
@scruffyfox
scruffyfox / CacheManager.java
Created November 10, 2013 19:59
Simple POJO Cache Manager
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
@scruffyfox
scruffyfox / BitmapUtil.java
Created October 31, 2013 16:06
Utils for bitmap processing
package com.cube.storm.lib.util;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;
import android.graphics.Matrix;
public class BitmapUtil
{
/**
@scruffyfox
scruffyfox / .structure
Last active December 24, 2015 13:59
Create playlist-like structure on file system
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Structure file for filelist.
;Each group is the path of the list, and each line after that is a link
;to include in that list
;
;This should be stored as .structure in the root directory
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[path=/media/music/by-genre/rock/]
/Users/callumtaylor/Desktop/test/media/music/Autopilot Off
@scruffyfox
scruffyfox / gist:6637543
Created September 20, 2013 13:27
Get fragment from position and view ID
private String getFragmentTag(int viewId, int index)
{
return "android:switcher:" + viewId + ":" + index;
}