Skip to content

Instantly share code, notes, and snippets.

Avatar

Nitin Raj Yadav Nitinrajyadav

View GitHub Profile
@Nitinrajyadav
Nitinrajyadav / .git-commit-template.txt
Last active Oct 3, 2019 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
View .git-commit-template.txt
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Provide links to all related tasks
# Example: https://example.com/#/tasks/1234
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any other relevant issues, articles or other resources
@Nitinrajyadav
Nitinrajyadav / Socket.java
Created Jan 19, 2019 — forked from AliYusuf95/OnEventListener.java
Websocket implementation using OkHttp3 with {event->data} message format to make your life easier.
View Socket.java
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
import java.net.ProtocolException;
import java.util.HashMap;
@Nitinrajyadav
Nitinrajyadav / Laravel-Container.md
Created Dec 15, 2017 — forked from davejamesmiller/Laravel-Container.md
Laravel's Dependency Injection Container in Depth
View Laravel-Container.md

Laravel's Dependency Injection Container in Depth

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

Accessing the Container

@Nitinrajyadav
Nitinrajyadav / IoTmanager.ino
Created Apr 12, 2017 — forked from 4refr0nt/IoTmanager.ino
ESP8266 client for IoT Manager (Android app)
View IoTmanager.ino
/*
IoT Manager mqtt device client https://play.google.com/store/apps/details?id=ru.esp8266.iotmanager
Based on Basic MQTT example with Authentication
PubSubClient library v 1.91.1 https://github.com/Imroy/pubsubclient
- connects to an MQTT server, providing userdescr and password
- publishes config to the topic "/IoTmanager/config/deviceID/"
- subscribes to the topic "/IoTmanager/hello" ("hello" messages from mobile device)
Tested with Arduino IDE 1.6.6 + ESP8266 Community Edition v 2.0.0-stable and PubSubClient library v 1.91.1 https://github.com/Imroy/pubsubclient
ESP8266 Community Edition v 2.0.0-stable have some HTTPS issues. Push notification temporary disabled.
@Nitinrajyadav
Nitinrajyadav / introrx.md
Created Apr 1, 2017 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@Nitinrajyadav
Nitinrajyadav / android.md
Created Mar 29, 2017 — forked from ahmedlhanafy/android.md
Android Cheat Sheet
View android.md

Android Cheat Sheet

Developer tips

Ripple Effect

android:clickable="true"
android:background="?attr/selectableItemBackground"

or

You can’t perform that action at this time.