Skip to content

Instantly share code, notes, and snippets.

Munish Kapoor manishkpr

Block or report user

Report or block manishkpr

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
View SwipeRefreshActivity.java
/*
* Copyright (C) 2014 Antonio Leiva Gordillo.
*
* 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 gist:a0fe47e753331e0d9887
//1 . Modify your MainActivity section in AndroidManifest.xml, delete from it, line with MAIN category in intent-//filter section
<activity android:name="ru.quickmessage.pa.MainActivity"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="portrait"
android:label="@string/app_name"
android:theme="@style/CustomTheme"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
View designer.html
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
View designer.html
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
View FloatLabelLayout.java
/*
* Copyright 2014 Chris Banes
*
* 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
@manishkpr
manishkpr / Swift JSON Parsing From String.swift
Last active Dec 30, 2016
Swift JSON Parsing From String
View Swift JSON Parsing From String.swift
let jsonString = "{\"id\":123,\"Name\":\"Munish\"}"
// convert String to NSData
var data: NSData =jsonString.dataUsingEncoding(NSUTF8StringEncoding)!
var error: NSError?
// convert NSData to 'AnyObject'
View gist:ca08c80b448becde72ef
<?php
//## Function to send GCM push notification
function sendMessageUsingGCM($registatoin_ids, $message) {
//## Google cloud messaging GCM-API url
$url = 'https://android.googleapis.com/gcm/send';
$fields = array( 'registration_ids' => $registatoin_ids, 'data' => $message,);
//## Update your Google Cloud Messaging API Key
@manishkpr
manishkpr / AppDelegate.swift
Created Aug 26, 2015
iOS-Swift Open AlertView Dialog From AppDelegate (UIApplicationDelegate)
View AppDelegate.swift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
@manishkpr
manishkpr / AddJsonObjectToJSONArray.java
Last active Aug 31, 2015
Adding or Appending JsonObject to Jsonarray in java
View AddJsonObjectToJSONArray.java
String jsonData = "{\"results\":[{\"lat\":\"value\",\"lon\":\"value\" }]}";
System.out.println(jsonData);
try {
JSONArray result = new JSONObject(jsonData).getJSONArray("results");
result.getJSONObject(0).put("city","Singapore");
jsonData = "{\"results\":"+result.toString()+"}";
System.out.println(jsonData);
} catch (JSONException e) {
e.printStackTrace();
}
@manishkpr
manishkpr / activity_main.xml
Created Nov 11, 2015
Andriod Material Tabs
View activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.webheavens.manishkprmaterialtabs.MainActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
You can’t perform that action at this time.