Skip to content

Instantly share code, notes, and snippets.


GVSharma gvsharma

Block or report user

Report or block gvsharma

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gvsharma / System
Created Jul 2, 2019 — forked from vasanthk/System
System Design Cheatsheet
View System

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
gvsharma / CustomFragmentsPresenter.cs
Created Oct 6, 2017 — forked from martijn00/CustomFragmentsPresenter.cs
Custom fragment handling in MvvmCross and Xamarin
View CustomFragmentsPresenter.cs
public class CustomFragmentsPresenter : MvxFragmentsPresenter
public interface IMvxFragmentHostEx : IMvxFragmentHost
void Close(IMvxViewModel viewModel);
void ChangePresentation (MvxPresentationHint hint);
private IMvxNavigationSerializer _serializer;
View MonkeysPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""
<ListView x:Name="list"
ItemsSource="{Binding MonkeysGrouped}"
View gist:da6afe9f1accbf91711805191d4d23b1
using System;
using System.Linq;
using Xamarin.Forms;
using System.Collections.Generic;
using System.ComponentModel;
namespace SampleApp
// Inherit from this page to get a multi-select option in XF
public class SelectMultipleBasePage<T> : ContentPage
View gist:57d0668a8826ae6fe58ced5eb1e843cd
public class CustomAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
//our items
List<Generic> items = new Arraylist<>();
List<View> headers = new ArrayList<>();
List<View> footers = new ArrayList<>();
public static final int TYPE_HEADER = 111;
public static final int TYPE_FOOTER = 222;
View gist:b46d69a278060e64b7df173e6e50e333
public class BlurUtil {
public static Bitmap blur(Context context, Bitmap sentBitmap, int radius) {
Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
final RenderScript rs = RenderScript.create(context);
final Allocation input = Allocation.createFromBitmap(rs, sentBitmap, Allocation.MipmapControl.MIPMAP_NONE,
import java.util.Map;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
gvsharma / getTmepFile() method
Created Jun 5, 2014
getting an image from camera or gallery and set it as
View getTmepFile() method
private Uri getTempFile(){
File root = new File(Environment.getExternalStorageDirectory(), "fashion_swap");
if (!root.exists()){
String filename=""+System.currentTimeMillis();
File file = new File(root,filename+".jpeg" );
Uri muri = Uri.fromFile(file);
selectedImagePath = muri.getPath();
Log.v("take picture path",selectedImagePath);
gvsharma / dataIntoPdf method
Last active Aug 29, 2015
Generating pdf with qPDF(qoppa software) library(refer
View dataIntoPdf method
public void dataIntoPdf(int noOfLines, ArrayList<Info> bookInfosById, PDFCanvas canvasId){
try {
float x = 40f;
float y = 60f;
for (int j = 0; j < bookInfosById.size();j++) {
int z = j;
Info myInfos = bookInfosById.get(j);
if (z < noOfLines) {
for (int v = 0; v <= z; v++) {
if (z == v) {
gvsharma / download an image from server
Created Jun 5, 2014
dounloading an image from server and save it in file
View download an image from server
Here arg[0] --> is the image url that we have to pass to this asynctask as parameter.
public class DownloadImage extends AsyncTask<String, Integer, Bitmap> {
protected void onPreExecute() {
You can’t perform that action at this time.