Skip to content

Instantly share code, notes, and snippets.

View yakubpashask's full-sized avatar

Yakub Pasha Shaik yakubpashask

  • Hyderabad
View GitHub Profile
(from : https://simplifiedthinking.co.uk/2015/10/03/install-mqtt-server/ )
Installing Brew
The Mosquitto MQTT Server can be easily installed using Homebrew. If it’s not installed on your system already, then a quick visit to the homepage will give you all you need to get going. Homebrew is an OS X Package Manager for installing and updating non-Mac OS X utilities that are more commonly found in other variants of Linux. To install the basic package manager run the following command.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installing Mosquitto MQTT
{"abRemainingSeatList":[],"ticketList":[{"Track_Id":"ODR3691200559234","UserTrackId":"0","adultConcessionAmount":"0.0","adultCount":1,"adultSeats":"9","agesList":"36","amentyAmount":"0.0","boardedLatitude":"17.496448","boardedLongitude":"78.297269","boardingPoint":"1661","boardingSeqNo":1,"boardingTime":"1661^KEERTHI MAHAL BUS STOP \u0026 CITY BUS PASS COUNTER IN BHEL TOWNS^9:30 PM","cessAmount":"0.0","childConcessionAmount":"0.0","childCount":0,"childSeats":"0","concessionAmount":"0.0","concessionId":"1347688949874","concessionShortCode":"REGU","couponCode":"","destination":1188,"destinationId":"10641","dropingPoint":"10641","dropingSeqNo":6,"email":"abc.def@xyz.com","gstAmount":"0.0","gt_lt":"1","isBoarded":"1","isConcession":"0","isStandingSeat":"0","jDate":"09 May 2020","mobile":"9542829992","offline_online":1,"passengerName":"Yakub","pisAmount":"0.0","psgrGender":"M","safetyCessAmount":"0.0","seatType":"0","selectedSeats":"9","serviceCharge":"","serviceKey":"1437000010515","serviceName":"BHEL(KMHL)-MTM",
@yakubpashask
yakubpashask / singleton.dart
Created April 9, 2020 17:54
Different Ways of Create Singleton classes in dart
//1. Factory constructor
class SingletonOne {
SingletonOne._privateConstructor();
static final SingletonOne _instance = SingletonOne._privateConstructor();
factory SingletonOne() {
return _instance;
}
final yesterday = DateTime(now.year, now.month, now.day); // today 12.00.00
final tomorrow = DateTime(now.year, now.month, now.day +1); //tomorrow 12.00.00
int diffInDays = tomorrow.difference(yesterday).inDays;
if (diffInDays == 0){
//custom code
print( "same day");
} else if( diffInDays > 0 ) {
// custom code
print("tomorrow is greater ");
@yakubpashask
yakubpashask / main.dart
Last active April 9, 2020 17:16
StackOverFlow-PrintData
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@yakubpashask
yakubpashask / main.dart
Last active April 8, 2020 17:25
TextFormFiled Error Border for dart pad
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
import Foundation
class Array2D<T> {
let columns: Int
let rows: Int
var array: Array<T?>
init(columns: Int, rows: Int) {
self.columns = columns
self.rows = rows
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@yakubpashask
yakubpashask / database.dart
Created September 13, 2019 11:18 — forked from simolus3/database.dart
Unsucessful attempt at reproducing moor#121
import 'dart:convert';
import 'package:moor_flutter/moor_flutter.dart';
part 'database.g.dart';
@DataClassName("Journal")
class Journals extends Table {
IntColumn get id => integer().autoIncrement()();
TextColumn get name => text().withLength(min: 1, max: 50)();
TextColumn get description => text().withLength(min: 1, max: 100)();
@yakubpashask
yakubpashask / StringTest.java
Last active September 14, 2019 11:31
String constant pool and String comparision
public class StringTest{
String a = "a"; // String constant pool
String b = new String("a"); // heap
a==b // not true becuase of different memory location based on the way they created
a.equlas(b) // true
//String b = "a"
StringBuilder builder = new StringBuilder(); // Extends the AbstractStringBuilder class - no thread saftey
StringBuffer buffer = new StringBuffer(); // Extends the AbstractStringBuilder class but all the required methods are synchrnozed so its thread safe