Skip to content

Instantly share code, notes, and snippets.

View JaisonBrooks's full-sized avatar

Jaison Brooks JaisonBrooks

  • Enphase Energy
  • Boise, ID
View GitHub Profile
@JaisonBrooks
JaisonBrooks / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
package your_package;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
/**
* A mixin which helps you to add depth to elements according to the Google Material Design spec:
* http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
*
* Please note that the values given in the specification cannot be used as is. To create the same visual experience
* the blur parameter has to be doubled.
*
* Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)
*
* Example usage:
package com.nhaarman.test;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RadialGradient;
/**
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session
* app.
* @author Dandré Allison
*/
public class AccountUtils {
/**
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}.
*/
@JaisonBrooks
JaisonBrooks / new_post_googleplus.java
Last active August 29, 2015 14:05
Text to new Google + post
Intent shareIntent = ShareCompat.IntentBuilder.from(ShareActivity.this)
.setText("This site has lots of great information about Android! http://www.android.com")
.setType("text/plain")
.getIntent()
.setPackage("com.google.android.apps.plus");
startActivity(shareIntent);
@JaisonBrooks
JaisonBrooks / listview_padding_fix
Created August 6, 2014 17:37
ListView - Padding Fix
<ListView
android:id="@+id/list_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="@android:color/transparent"
android:dividerHeight="10.0sp"
android:padding="16dip"
android:clipToPadding="false"/>
// The Magic is this | android:clipToPadding="false"
@JaisonBrooks
JaisonBrooks / data-transfer-bash-shell
Created August 4, 2014 16:00
Transfer Files between computers - Bash
# on computer A, with IP address 192.168.1.100
$ tar -cf - /path/to/dir | pv | nc -l -p 6666 -q 5
# on computer B
$ nc 192.168.1.100 6666 | pv | tar -xf -
@JaisonBrooks
JaisonBrooks / bash-progress
Created August 4, 2014 15:54
Bash-Progress Bar
echo -ne '##### (33%)\r'
sleep 1
echo -ne '############# (66%)\r'
sleep 1
echo -ne '####################### (100%)\r'
echo -ne '\n'
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file.
set the background of a view to card,
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view
``` xml
<View
android:layout_width="fill_parent"