Skip to content

Instantly share code, notes, and snippets.

View ColeMurray's full-sized avatar

Cole Murray ColeMurray

View GitHub Profile
public class LoginScreen extends Activity {
Button createButton = (Button) findViewById(R.id.uButton);
EditText uField = (EditText) findViewById(R.id.uField);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_screen);
@ColeMurray
ColeMurray / gist:c5a98fcce8c051ef35b6
Created March 23, 2015 22:48
Google Fit Cumulative History
DataReadResult step_result = getStepData(mFitClient,buildStepRequest(date));
public static DataReadResult getStepData (GoogleApiClient mClient, DataReadRequest request){
PendingResult <DataReadResult> pendingResult =
Fitness.HistoryApi.readData(mClient,request);
DataReadResult dataReadResult = pendingResult.await();
printStepResult(dataReadResult);
return dataReadResult;
}
private static void printStepResult (DataReadResult dataReadResult){
if (Object.keys(args).length === 1) {
for (let key in args) {
if (args.hasOwnProperty(key)) {
queryString += `${key}=${args[key]}`;
}
}
} else if (Object.keys(args).length > 1) {
// else if keys length is larger than one key concat the querystring
// like so
for (let key in args) {
/* TodoTextInput.react
A react component that handles text input. It updates on
enter being pressed
*/
import React from 'react'
const ENTER_KEY_CODE = 13
class TodoTextInput extends React.Component {
constructor(props) {
function plotData(x, y)
%PLOTDATA Plots the data points x and y into a new figure
% PLOTDATA(x,y) plots the data points and gives the figure axes labels of
% population and profit.
plot(x,y,'rx', 'MarkerSize', 10);
ylabel('Profit in $10,000s');
xlabel('Population of city in 10,000s');
% ====================== YOUR CODE HERE ======================
% Instructions: Plot the training data into a figure using the
% "figure" and "plot" commands. Set the axes labels using
@ColeMurray
ColeMurray / TodoTextInput.react.js
Created October 22, 2015 04:20
A react component that handles text input. It updates on enter being pressed
/* TodoTextInput.react
A react component that handles text input. It updates on
enter being pressed
*/
import React from 'react'
const ENTER_KEY_CODE = 13
class TodoTextInput extends React.Component {
@ColeMurray
ColeMurray / Header.react.js
Created October 22, 2015 04:32
A header wrapper in react
import React from 'react'
import TodoTextInput from './TodoTextInput.react'
class Header extends React.Component {
constructor(props) {
super(props)
}
onSave(text) {
console.log(text)
}
import ReactDOM from 'react-dom'
import React from 'react'
import Header from './components/Header.react'
ReactDOM.render(<Header />, document.getElementById('todo-input'))
@ColeMurray
ColeMurray / VisibilityTracker.java
Last active January 17, 2016 23:29
Skeleton for VisibilityTracker
package com.murraycole.impressiontutorial;
import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver;
import java.util.List;
import java.util.WeakHashMap;
package com.murraycole.impressiontutorial;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
public class ImpressionAdapter extends RecyclerView.Adapter<ProductViewHolder> {