Skip to content

Instantly share code, notes, and snippets.

View iamswapnilsonar's full-sized avatar

Swapnil Sonar iamswapnilsonar

View GitHub Profile
@iamswapnilsonar
iamswapnilsonar / fuplicate_json.js
Created January 12, 2017 14:54
Sample javascript program to identify duplicates elements in JSON file. Feel free to add your suggestions.
var data = [
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Albania",
"dial_code": "+355",
"code": "AL"
@iamswapnilsonar
iamswapnilsonar / isd_country_code.json
Created November 7, 2016 12:28
All the country list along with Country code and Dial Code. Please let me know if any suggestions.
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Albania",
"dial_code": "+355",
"code": "AL"
@iamswapnilsonar
iamswapnilsonar / index.php
Last active November 7, 2016 12:24
If you want to create simple pagination example in PHP, you could do something like this.
<?php
//Swapnil_Sonar workspace
$sample_data = '[{"id":1,"name":"Item1","type":"Android"},{"id":2,"name":"Item2","type":"Android"},{"id":3,"name":"Item3","type":"iOS"},{"id":4,"name":"Item4","type":"Windows"},{"id":5,"name":"Item5","type":"iOS"},{"id":6,"name":"Item6","type":"Android"},{"id":7,"name":"Item7","type":"Windows"}]';
// just normal getting data
$raw_data = json_decode($sample_data, true);
// use get variable to paging number
$page = 2; //!isset($_GET['page']) ? 1 : $_GET['page'];
$limit = 5; // five rows per page
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.google.android.sample"
android:versionCode="12"
android:versionName="1.0.12" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
package in.google.android.sample;
import android.content.pm.ApplicationInfo;
import android.graphics.drawable.Drawable;
/**
* @author Swapnil Sonar
* @Date 01/07/2015
*/
public class PackageInfoBean {
package in.google.android.sample;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.util.Log;