Skip to content

Instantly share code, notes, and snippets.

View yoosinpaddy's full-sized avatar

Yoosin Paddy yoosinpaddy

View GitHub Profile
googlemap.addMarker(new MarkerOptions()
.position(new LatLng( 65.07213,-2.109375))
.title("This is my title")
.snippet("and snippet")
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE)));///This is orange color
@yoosinpaddy
yoosinpaddy / MainActivity.java
Created May 25, 2021 21:31
prevent screenshot in android app
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,WindowManager.LayoutParams.FLAG_SECURE);
//add this code in the oncreate of an activity before set content view
@yoosinpaddy
yoosinpaddy / remaining_time.dart
Created February 14, 2022 21:19
Get More friendly remaining time from date and time string in flutter
String getRemainingTime(String? deadline) {
String toRet = "";
int remSecs = secondsBetween(DateTime.now(), DateTime.parse(deadline!));
if (remSecs < 0) {
isUrgent=true;
toRet = "Overdue by ";
remSecs = remSecs * -1;
}
int mdays = (remSecs / 86400).truncate();
@yoosinpaddy
yoosinpaddy / DetailActivity.kt
Created April 5, 2022 22:12
Hide Keyboard Kotlin
fun hideKeyboard(activity: Activity) {
val imm: InputMethodManager =
activity.getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
//Find the currently focused view, so we can grab the correct window token from it.
var view = activity.currentFocus
//If no view currently has focus, create a new one, just so we can grab a window token from it
if (view == null) {
view = View(activity)
}
imm.hideSoftInputFromWindow(view.windowToken, 0)
@yoosinpaddy
yoosinpaddy / alibaba-vendor.md
Created April 24, 2022 20:23 — forked from emilio-martinez/alibaba-vendor.md
Topin 365GPS Server config

365GPS office address Contact: Erik Liu Address: 505 Block B, Donglian Building, Chuangye Second Road, Baoan District, Shenzhen, Guangdong, China(广东省深圳市宝安区创业二路东联大厦B座505,洪浪北地铁站旁) Mobile/ wechat/ whatsapp: +86-13480999031
Alibaba: 365gps.en.alibaba.com Skype: topin.sales
E-mail: topin.sales3@qq.com

============================================================= Hi

@yoosinpaddy
yoosinpaddy / register.blade.php
Created May 4, 2022 14:26
html phone number validation with country code
<div class="form-group mb-2">
<label class="form-label" for="mobileNo">{{__('phoneNumber')}}</label>
<input required type="text" class="form-control" id="mobileNo" name="phone"
placeholder="{{__('enterPhoneNumber')}}" pattern="\+[0-9]{1,3}[0-9]{9,}"
title="Phone number must start with country code and have at least 10 digits">
</div>
@yoosinpaddy
yoosinpaddy / formatnumber.php
Created May 11, 2022 02:40
Format number add k for more than 1000
public function formatNumber($number)
{
// add k format
if ($number >= 1000 && $number < 1000000) {
$number = number_format($number / 1000, 1) . 'k';
} elseif ($number >= 1000000) {
$number = number_format($number / 1000000, 1) . 'm';
}
return number_format($number, 2, '.', ',');
}
@yoosinpaddy
yoosinpaddy / Main.java
Last active June 30, 2022 09:33
Reverse Double linked List
package com.company;
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
@yoosinpaddy
yoosinpaddy / InsertNodeToLinkedList.java
Last active July 1, 2022 13:33
Insert a node at a specific position in a linked list
package com.company;
import java.io.*;
import java.util.*;
public class Solution {
static class SinglyLinkedListNode {
public int data;
public SinglyLinkedListNode next;
@yoosinpaddy
yoosinpaddy / MergeLinkedListASC.java
Created July 1, 2022 15:37
Merge two linked list of integers in ascending order
package com.company;
import java.io.*;
import java.util.*;
public class Solution {
static class SinglyLinkedListNode {
public int data;
public SinglyLinkedListNode next;