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 <AceButton.h> | |
#include <Keyboard.h> | |
#include <LinkedList.h> | |
using namespace ace_button; | |
typedef LinkedList<int> KeyCodes; | |
class Key: public IEventHandler { | |
private: | |
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 "Key.h" | |
static const uint8_t NUM_PINS = 4; | |
static const uint8_t NUM_BUTTONS = 12; | |
static const uint8_t PINS[NUM_PINS] = {4, 5, 6, 7}; | |
Key *keys; | |
static AceButton b01(1); | |
static AceButton b02(2); |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
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
@RunWith(AndroidJUnit4.class) | |
public class DatabaseInstrumentedTest { | |
private static final String TEST_DB_NAME = "test_database"; | |
@Rule | |
public MigrationTestHelper testHelper = | |
new MigrationTestHelper( | |
InstrumentationRegistry.getInstrumentation(), | |
TestDatabase.class.getCanonicalName(), |
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
FROM openjdk:8-jdk | |
MAINTAINER Angad Singh <angads25@gmail.com> | |
CMD ["gradle"] | |
ENV GRADLE_HOME /opt/gradle | |
ENV GRADLE_VERSION 5.6.4 | |
ARG GRADLE_DOWNLOAD_SHA256=abc10bcedb58806e8654210f96031db541bcd2d6fc3161e81cb0572d6a15e821 | |
RUN set -o errexit -o nounset \ |
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
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
public interface OnItemClickListener { | |
void onClick(RecyclerView parent, View v, int position); | |
} |
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
public class Utility { | |
public static void copyDatabaseToSdcard(Context context, String databaseName) { | |
if(BuildConfig.DEBUG) { | |
String currentDBPath = context.getDatabasePath(databaseName).getAbsolutePath(); | |
String downloadDir = Environment.getExternalStorageDirectory() + "/Dump/" + databaseName + ".db"; | |
File dataBase = new File(currentDBPath); | |
File file = new File(downloadDir); | |
try { | |
file.delete(); |
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
import com.github.angads25.javaplayground.model.UniqueListItem; | |
import java.util.AbstractList; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
public class SortedUniqueList<T extends UniqueListItem> extends AbstractList<T> { | |
private ArrayList<T> internalList = new ArrayList<>(); | |
@Override public boolean add(T t) { |