Skip to content

Instantly share code, notes, and snippets.

View professionalsna's full-sized avatar
💭
Working

Naveed Ahmed professionalsna

💭
Working
View GitHub Profile
@professionalsna
professionalsna / NavRequestHandler.ashx
Last active June 9, 2017 11:46
ASP.NET: Web service type implementation to return JSON
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
@professionalsna
professionalsna / volley-POST-example.java
Created October 23, 2017 06:27 — forked from mombrea/volley-POST-example.java
Example of performing a POST request using Google Volley for Android
public static void postNewComment(Context context,final UserAccount userAccount,final String comment,final int blogId,final int postId){
mPostCommentResponse.requestStarted();
RequestQueue queue = Volley.newRequestQueue(context);
StringRequest sr = new StringRequest(Request.Method.POST,"http://api.someservice.com/post/comment", new Response.Listener<String>() {
@Override
public void onResponse(String response) {
mPostCommentResponse.requestCompleted();
}
}, new Response.ErrorListener() {
@Override
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
// network configuration. dns server, gateway and subnet are optional.
// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
@professionalsna
professionalsna / NavLogUtility.cs
Last active October 8, 2020 07:33
Log Response to File TXT, XML or Json using C# Helper
public enum NavFileTypes {
TXT,
JSON,
XML
}
class NavUtilities
{
public static void LogResponseToFile(string content ,string fileName, NavFileTypes fileTypes)