This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CenteredTitleToolbar | |
// | |
// Created by Ben De La Haye on 25/05/2016. | |
// | |
public class CenteredTitleToolbar extends Toolbar { | |
private TextView _titleTextView; | |
private int _screenWidth; | |
private boolean _centerTitle = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Ben on 28/09/2016. | |
// Copyright (c) 2016 SHAPE A/S. All rights reserved. | |
// | |
public class PaddingItemDecoration extends RecyclerView.ItemDecoration { | |
private final Context _context; | |
private Resources _resources; | |
private Paint _paint = new Paint(Paint.ANTI_ALIAS_FLAG); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Usage : | |
// recyclerView.setLayoutManager(new SmoothScrollingLayoutManager(getContext())); | |
// recyclerView.smoothScrollToPosition(0); | |
// | |
// | |
// SmoothScrollingLayoutManager | |
// Makersphere | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open a terminal window and cd into a folder under the repository. Then: | |
git fsck | awk '{print $3}' > tmp.txt | |
cat tmp.txt | xargs git show > tmp2.txt | |
Now open tmp2.txt in editor, locate your lost code, and find the commit-id on top of it. Then apply the code: | |
git stash apply <commit id> | |
rm tmp.txt tmp2.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// GoogleSignInManager | |
// Created by Ben De La Haye on 24/03/2016. | |
// | |
public class GoogleSignInManager implements GoogleApiClient.OnConnectionFailedListener { | |
public interface Listener { | |
void onUserSignedIn(GoogleSignInAccount account); | |
void onUserSignInFailed(int errorCode, String errorMessage); | |
void onUserDataRetrieved(@Nullable Person person); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BaseAuthActivity | |
// Created by Ben De La Haye on 28/04/2016. | |
// | |
public abstract class BaseAuthActivity extends BaseActivity implements GoogleSignInManager.Listener, Callback<LoginResponse> { | |
private GoogleSignInManager _googleSignInManager; | |
private AuthenticatedUser authenticatedUser; | |
public abstract void onUserLoggedIn(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ParallaxScrollBehaviour | |
// Created by Ben De La Haye on 17/10/2016 | |
// | |
public class ParallaxScrollBehavior<V extends View> extends CoordinatorLayout.Behavior<V> { | |
private static final float PARALLAX_RATIO = 0.8f; | |
private RecyclerView _recyclerView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<android.support.design.widget.CoordinatorLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<LinearLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb devices (See if Dragonboard is connected) | |
adb shell (Open shell on Dragonboard) | |
su (Need super user access) | |
cd sys/class/gpio (Navigate to GPIO directory) | |
==> GPIO pin numbers are offset by 902 (pin 34 => GPIO 935) | |
echo {GPIO number, eg. 935} > export (Exports GPIO to be accessed and modified) | |
cd {exported GPIO number directory, eg. gpio935} | |
ls (Lists commands available for GPIO) | |
cat direction (prints direction (IN or OUT)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Adafruit_DHT.h" | |
#include "LiquidCrystal.h" | |
// | |
// Ben De La Haye | |
// CloudTemp-v5.ino | |
// | |
// Reads temp and humidity from DHT22 sensor and writes values to LCD panel, Particle | |
// server and Serial. |
OlderNewer