Skip to content

Instantly share code, notes, and snippets.

View AbsolutelySaurabh's full-sized avatar
🤗
Give me a problem, and I can write a partially running code in Java, Go, C/C++

Saurabh Singh AbsolutelySaurabh

🤗
Give me a problem, and I can write a partially running code in Java, Go, C/C++
View GitHub Profile
@AbsolutelySaurabh
AbsolutelySaurabh / HomeFragment.java
Created July 10, 2017 05:29
MyQ app crash issue solved.
package dd.com.myq.Fragment;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
@AbsolutelySaurabh
AbsolutelySaurabh / gist:8c146a75000ead9519a2d80e2f4ca146
Created December 26, 2017 12:05
How to highlight selected item in RecyclerView
package com.appsomniac.swagger.data.adapter;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.graphics.Color;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.RecyclerView;
package com.example.absolutelysaurabh.perbmember.MealsData
import android.annotation.SuppressLint
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
@AbsolutelySaurabh
AbsolutelySaurabh / README.md
Created June 14, 2018 17:07 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//db.go
SELECT_DISTINCT_MASTER_TYPES = "select distinct master_type from master_types"
//admin.go
master_type := Admin.AddResource(&models.MasterType{}, &admin.Config{
Permission: configuration.GetPermission(C.MODEL_MASTER_TYPE),
PageCount: C.PAGE_COUNT})
master_type.Meta(&admin.Meta{
Name: "Master_Type",
//admin
booking.Filter(&admin.Filter{
Label: "Created At",
Name: "CreatedAt",
Type: "datetime",
Handler: func(db *gorm.DB, argument *admin.FilterArgument) *gorm.DB {
startDate := argument.Value.Get("Start").Value
endDate := argument.Value.Get("End").Value
Handler: func(db *gorm.DB, argument *admin.FilterArgument) *gorm.DB {
startDate := argument.Value.Get("Start").Value
endDate := argument.Value.Get("End").Value
startDateTime, _ := time.Parse(C.DATE_YYYY_MM_DD_HH_MM, utils.ToString(startDate))
endDateTime, _ := time.Parse(C.DATE_YYYY_MM_DD_HH_MM, utils.ToString(endDate))
diffStartEnd := startDateTime.Sub(Date(endDateTime.Year(), endDateTime.Month(), endDateTime.Day(), endDateTime.Hour(), endDateTime.Minute())).Hours() / 24
log.Printf("diffStartEnd: %f", diffStartEnd)
if diffStartEnd < 0 {
@AbsolutelySaurabh
AbsolutelySaurabh / .gitignore
Created August 23, 2019 17:02 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #