Skip to content

Instantly share code, notes, and snippets.

@Xiryl
Xiryl / BluetoothUtils.kt
Created August 12, 2021 09:14
BluetoothSDK-BluetoothUtils
class BluetoothUtils {
companion object {
val ACTION_DISCOVERY_STARTED = "ACTION_DISCOVERY_STARTED"
val ACTION_DISCOVERY_STOPPED = "ACTION_DISCOVERY_STOPPED"
val ACTION_DEVICE_FOUND = "ACTION_DEVICE_FOUND"
val ACTION_DEVICE_CONNECTED = "ACTION_DEVICE_CONNECTED"
val ACTION_DEVICE_DISCONNECTED = "ACTION_DEVICE_DISCONNECTED"
val ACTION_MESSAGE_RECEIVED = "ACTION_MESSAGE_RECEIVED"
val ACTION_MESSAGE_SENT = "ACTION_MESSAGE_SENT"
val ACTION_CONNECTION_ERROR = "ACTION_CONNECTION_ERROR"
@Xiryl
Xiryl / .eslintrc
Created July 11, 2020 08:20
eslint-guide-4
{
...,
rules: {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"indent": [2, 4],
"react/jsx-indent": [2, 4],
"react/jsx-indent-props": [2, 4],
"react/prefer-stateless-function": [1, { "ignorePureComponents": true }],
"import/no-extraneous-dependencies": [1, {"peerDependencies": true}],
"import/no-extraneous-dependencies": "off",
@Xiryl
Xiryl / .editorconfig
Created July 11, 2020 08:18
eslint-guide-3
root = true
[*]
indent_style = space
indent_size = 4
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@Xiryl
Xiryl / VScode-settings
Created July 11, 2020 08:09
eslint-guide-2
{
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": false,
},
"eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"prettier.disableLanguages": [
"js"
],
@Xiryl
Xiryl / .eslintrc
Created July 11, 2020 08:03
eslint-guide-1
{
"extends": ["react-app", "plugin:prettier/recommended"]
}
@Xiryl
Xiryl / .eslintrc
Created July 11, 2020 07:51
eslint-guide
{
"extends": "react-app",
"rules": {
"no-console": "warn"
}
}
@Xiryl
Xiryl / widget_list_item.xml
Last active May 6, 2020 15:45
WidgetGuide-2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white">
<TextView
android:id="@+id/widget_list_item_message"
android:layout_width="match_parent"
@Xiryl
Xiryl / widget_layout.xml
Created May 6, 2020 15:32
WidgetGuide-1
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- ListView to be shown on widget -->
<ListView
android:id="@+id/widget_layout_listview"
android:layout_width="match_parent"
@Xiryl
Xiryl / bottomappbar-example-6
Created January 11, 2019 09:46
bottomappbar-example-6
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<android.support.design.bottomappbar.BottomAppBar
android:id="@+id/bar"
@Xiryl
Xiryl / bottombappbar-example-5
Created January 11, 2019 09:31
bottombappbar-example-5
<android.support.design.widget.FloatingActionButton
android:id="@+id/fav"
android:elevation="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchor="@id/bar"
android:src="@drawable/ic_add"/>