Skip to content

Instantly share code, notes, and snippets.

Abijeet AbijeetP

Block or report user

Report or block AbijeetP

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 acf-repeater-get-post-meta.php
<?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 );
@AbijeetP
AbijeetP / my.cnf
Last active Aug 9, 2016
MariaDB configuration file
View my.cnf
#
# 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
View 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 / Utility.java
Created Jun 12, 2013
Utility class that checks on an Android device whether it has GPS, SD Card, Network Connectivity.
View Utility.java
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 / saveData.cs
Created Jun 7, 2013
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
View saveData.cs
[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
View SendDataToService.java
// 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();
You can’t perform that action at this time.