Skip to content

Instantly share code, notes, and snippets.

FavoritesContract.FavoritesEntry.ContentUris.CONTENT_URI,
new String[] {FavoritesContract.FavoritesEntry.COL_THEMOVIEDBKEY,
FavoritesContract.FavoritesEntry.COL_TITLE,
FavoritesContract.FavoritesEntry.COL_RELEASE_DATE,
FavoritesContract.FavoritesEntry.COL_VOTE_AVERAGE,
FavoritesContract.FavoritesEntry.COL_POSTER_PATH,
FavoritesContract.FavoritesEntry.COL_POSTER_TYPE,
FavoritesContract.FavoritesEntry.COL_BACKDROP_PATH,
FavoritesContract.FavoritesEntry.COL_OVERVIEW },
FavoritesContract.FavoritesEntry.COL_THEMOVIEDBKEY + " = ?",
public static class OldFavoritesEntry {
public static final Uri CONTENT_URI =
BASE_CONTENT_URI.buildUpon().appendPath(PATH_FAVORITES).build();
public static final String CONTENT_TYPE =
ContentResolver.CURSOR_DIR_BASE_TYPE + "/" + CONTENT_AUTHORITY + "/" + PATH_FAVORITES;
public static final String CONTENT_ITEM_TYPE =
ContentResolver.CURSOR_ITEM_BASE_TYPE + "/" + CONTENT_AUTHORITY + "/" + PATH_FAVORITES;
// Table name
@robbiemu
robbiemu / WindView.java
Last active April 27, 2016 14:29
a custom view that indicates wind speed and direction
package com.example.android.sunshine.app;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
@robbiemu
robbiemu / WindView.java
Created March 24, 2016 18:42
need to refactor this bad boy
package com.example.android.sunshine.app;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
@robbiemu
robbiemu / Angularjs - Selected value row.md
Last active March 30, 2016 01:54
Angularjs - Selected value row

If you don't move the button into the ng-repeat element, there will only be one button for the entire form. Therefore, the user will not be selecting any column or row at the moment they press the button.

One could get around that by changing the prescribed user behavior:

  • First: the user clicks the row/column as per normal
  • Second: the user then clicks the button, which shows the alert.

The button would be:

click

@Override
public void onClick(View v) {
Field f;
int rid;
String name = "unknown View";
try {
f = R.id.class.getDeclaredField(Integer.toString(v.getId()));
rid = f.getInt(f);
name = MainActivity.this.getString(rid);
} catch (Exception e) {
package com.example.android.sunshine.app;
import android.support.v7.app.ActionBarActivity;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
@robbiemu
robbiemu / MarkdownContent.java
Created February 1, 2016 13:57
working on using DummyContent.java for markdown pages
package xyz.selfenrichment.robertotomas.camtutnotes.markdown;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Document;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@robbiemu
robbiemu / v1 Lunara build
Last active April 27, 2016 14:30
a script I was using to reformat the presentation of game data for heroes of the Storm at hotslogs.com
// ==UserScript==
// @name HotSLogs Role Sorting icons
// @namespace https://gist.github.com/robbiemu/02882b97f38ef98774d4/
// @version v1 Lunara build
// @description Provides roll icons for each class, which are clickable to toggle hiding of other classes
// @author Robbiemu
// @include /https?\:\/\/www.hotslogs.com\//
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @grant none
// ==/UserScript==
// ==UserScript==
// @name HotSLogs Role Sorting icons
// @namespace https://gist.github.com/robbiemu/02882b97f38ef98774d4/
// @version v1_4.12.15
// @description Provides roll icons for each class, which are clickable to toggle hiding of other classes
// @author Robbiemu
// @include /https?\:\/\/www.hotslogs.com\//
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @grant none
// ==/UserScript==