Skip to content

Instantly share code, notes, and snippets.

View ri5h's full-sized avatar
πŸ‘¨β€πŸ’»
Working from home

Rishiraj Purohit ri5h

πŸ‘¨β€πŸ’»
Working from home
View GitHub Profile
@ri5h
ri5h / SamplePage1.html
Created September 1, 2018 09:16
Sample page header section
<!-- http://therunapp.co/wp-content/uploads/2018/06/simple-website-download-sample-html-page-template-login-free.jpg -->
<!DOCTYPE html>
<html>
<head>
<title>Sample Page</title>
</head>
<body>
<!-- Header -->
<div style="background-color:#12ac90;height: 200px;">
@ri5h
ri5h / home.html
Created September 1, 2018 08:17
Basic html tags intro
<html>
<head>
<title>GIT Home</title>
</head>
<body >
<h1>Welcome to GIT</h1>
<br/>
<hr/>
<br/>
@ri5h
ri5h / MainActivity.java
Created June 19, 2017 08:18
Get files from android device
package in.rishirajpurohit.android.fileaccess;
import android.Manifest;
import android.content.ContentResolver;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Color;
import android.net.Uri;
import android.os.Environment;
import android.provider.MediaStore;
public void checkPerms(){
if (ContextCompat.checkSelfPermission(MainActivity.this,
Manifest.permission.READ_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,
Manifest.permission.READ_EXTERNAL_STORAGE)) {
// Show an explanation to the user *asynchronously* -- don't block
@ri5h
ri5h / header.php
Last active June 20, 2016 20:02
Woocommerce, get cart total , get total number of items in care , get woocommerce shop page , get checkout page and other things.
global $woocommerce;
//Get url of cart page
$cart_url = WC_Cart::get_cart_url(); //one way to do it
$checkout_url = WC_Cart::get_checkout_url();
//Get total value of cart
$cart_total = $woocommerce->cart->get_cart_total(); //other way to do it
//Get number of cart items