Skip to content

Instantly share code, notes, and snippets.

manish maharjan mmanishh

Block or report user

Report or block mmanishh

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
@mmanishh
mmanishh / ChatMessage.java
Created Nov 30, 2016 — forked from puf/ChatMessage.java
Zero to App: Develop with Firebase (for Android - Google I/O 2016)
View ChatMessage.java
package com.google.firebase.zerotoapp;
public class ChatMessage {
public String name;
public String message;
public ChatMessage() {
}
public ChatMessage(String name, String message) {
@mmanishh
mmanishh / DividerItemDecoration.java
Created Sep 7, 2016 — forked from alexfu/DividerItemDecoration.java
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
View DividerItemDecoration.java
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View NewCurveFour
public PointF calcNextPoint(float theta) {
int t = (int) (theta * 1000);
float temp = (radius * ct.objMathHelper.Sin[t]);
return
new PointF(radius*(3*ct.objMathHelper.Sin[t]-4*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t])+mCenter.x
,radius*0.6f*ct.objMathHelper.Cos[t]+mCenter.y
);
}
View Crazy circle run curve
public PointF calcNextPoint(float theta) {
int t = (int) (theta * 1000);
float temp = (radius * ct.objMathHelper.Sin[t]);
return
new PointF(
(radius*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t]*ct.objMathHelper.Cos[t])
+ ct.objMathHelper.Cos[t]+ mCenter.x,
(radius*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t]*ct.objMathHelper.Sin[t])
-ct.objMathHelper.Sin[t]+ mCenter.y
);
View parallax appbar
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
View Loadshedding
package com.manishm.popularmovies.ui.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.manishm.popularmovies.R;
import com.manishm.popularmovies.adapter.LoadsheddingAdapter;
import com.manishm.popularmovies.model.Loadshedding;
View AppController.java
package info.androidhive.volleyexamples.app;
import info.androidhive.volleyexamples.volley.utils.LruBitmapCache;
import android.app.Application;
import android.text.TextUtils;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
View CrashPeventer.class
public class LoggingExceptionHandler implements java.lang.Thread.UncaughtExceptionHandler {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
StringWriter stackTrace = new StringWriter();
ex.printStackTrace(new PrintWriter(stackTrace));
String msg = "WALT crashed with the following exception:\n" + stackTrace;
// Fire a new activity showing the stack trace
Intent intent = new Intent(MainActivity.this, CrashLogActivity.class);
View sms.php
<?php
$message = array("Alert! EarthQuake is likely to occur within 15 mins.", "Hi! from Manish", "Wassup ?");
$pos =mt_rand(0,count($message));
$api_url = "http://api.sparrowsms.com/v2/sms/?".
http_build_query(array(
'token' => 'QRtl8w1FQvlVqcrWrkHv ',
View EndlessRecyclerOnScrollListener.java
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
You can’t perform that action at this time.