Skip to content

Instantly share code, notes, and snippets.

@AbijeetP
AbijeetP / saveData.cs
Created June 7, 2013 10:15
ASPX Code that is callled on the web service by the android code. You can find the android code https://gist.github.com/AbijeetOSM/5728322
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
#region Save User Data
public string saveUserData(string name, string email, string address)
{
Contact cntObj = new Contact(name, email, address);
// Save Contact Details takes care of all the storage part and such.
return saveContactDetails(cntObj);
}
#endregion
// Making an HTTP Post call, and passing the URL
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("content-type", "application/json");
HttpClient httpClient = new DefaultHttpClient(getHttpParameterObj(4000,4000));
// Building the JSON object.
JSONObject data = new JSONObject();
@AbijeetP
AbijeetP / Utility.java
Created June 12, 2013 11:26
Utility class that checks on an Android device whether it has GPS, SD Card, Network Connectivity.
package osm.droid.osmcontactus;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public class Utility {
static Context context;
@AbijeetP
AbijeetP / chart.js
Last active March 15, 2016 09:10
Chart.js
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
},{}],2:[function(require,module,exports){
/* MIT license */
var convert = require("color-convert"),
string = require("color-string");
var Color = function(obj) {
if (obj instanceof Color) return obj;
@AbijeetP
AbijeetP / my.cnf
Last active August 9, 2016 06:27
MariaDB configuration file
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# FromDual configuration file template for MySQL, Galera Cluster, MariaDB and Percona Server
# Location: /etc/my.cnf or /etc/mysql/my.cnf
# This template is intended to work with MySQL/MariaDB 5.5 and newer
@AbijeetP
AbijeetP / acf-repeater-get-post-meta.php
Created February 17, 2019 15:24 — forked from palicko/acf-repeater-get-post-meta
ACF repeater via get_post_meta()
<?php
// Returns array with repeater subfields and its values
function repeater_get_post_meta( $repeater_key, $post_id, $sub_field_keys ) {
if ( ! $post_id ) {
$post_id = get_the_ID();
}
// get repeater field
$repeater = get_post_meta( get_the_ID(), $repeater_key, true );