Skip to content

Instantly share code, notes, and snippets.

package io.dwak.holohackernews.app.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import com.facebook.rebound.Spring;
import com.facebook.rebound.SpringConfig;
import com.facebook.rebound.SpringListener;
import com.facebook.rebound.SpringSystem;
/*
* Copyright (C) 2013 The Android Open Source Project
*
* 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
@burntcookie90
burntcookie90 / chrome-os-apk.py
Last active August 29, 2015 14:06
Python script to automate the creation of a chromeos apk during development
#!/usr/local/bin/python
import shutil
import json
from subprocess import call
import os
shutil.copyfile("app/build/outputs/apk/app-debug.apk", <packagename.apk>)
os.system("chromeos-apk <packagename.apk> -a")
with open('<packagename.apk>.android/manifest.json', "r+") as manifestFile:
manifestJson = json.load(manifestFile)
manifestJson["permissions"].append(<extra permissions>)
@burntcookie90
burntcookie90 / BaseFragment.java
Created September 22, 2014 14:08
BaseFragment class that handles registration with the event bus
public class BaseFragment extends Fragment {
public BaseFragment() {}
@Override public void onResume() {
super.onResume();
BusProvider.getInstance().register(this);
}
@burntcookie90
burntcookie90 / adb_quick_screen.sh
Created September 24, 2014 15:28
adb_quick_screen.sh
#!/bin/bash
binary=$(which adb)
filename=$HOME/screen_$(date +"%H%M%S").png
if [ -e $binary ]
then
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png $filename
adb shell rm /sdcard/screen.png
echo "Screenshot written to $filename"
@burntcookie90
burntcookie90 / Events.java
Last active August 29, 2015 14:07
RxLoginExample
package com.example.vrajeevan.rxloginexample.rx;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.MotionEvent;
import android.widget.Button;
import android.widget.TextView;
import rx.Observable;
import rx.subjects.BehaviorSubject;
@burntcookie90
burntcookie90 / GCMRegistration.java
Created October 20, 2014 17:58
Helper for gcm registration
public class GCMRegistration {
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 9000;
private String mSenderId;
private Activity mActivity;
private GoogleCloudMessaging mGCM;
private String mRegId;
public GCMRegistration(Activity activity) {
mActivity = activity;
}
@burntcookie90
burntcookie90 / SlidingTabLayout.java
Created October 30, 2014 03:21
SlidingTabLayout from google's 2014 iosched
/*
* Copyright 2014 Google Inc. All rights reserved.
*
* 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
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="?attr/colorPrimary"/>
local/cantarell-fonts 0.0.16-1
Cantarell font family
local/fontconfig 2.11.1-1
A library for configuring and customizing font access
local/fontforge 20141014-1
Outline and bitmap font editor
local/fontsproto 2.1.3-1
X11 font extension wire protocol
TrueType font rendering library with ClearType patch
OpenGL library to use arbitrary fonts