Skip to content

Instantly share code, notes, and snippets.

@siddharth-pandey
siddharth-pandey / http-status-codes.md
Created May 30, 2018 23:18 — forked from subfuzion/http-status-codes.md
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.
@siddharth-pandey
siddharth-pandey / mock-service-example.js
Created November 25, 2016 22:19 — forked from alicial/mock-service-example.js
AngularJS: Setting up a mocked service to use in controller unit tests.
// Mocked Service
angular.module('mock.users', []).
factory('UserService', function($q) {
var userService = {};
userService.get = function() {
return {
id: 8888,
name: "test user"
}
http://www.developerfusion.com/article/8307/aspnet-patterns-every-developer-should-know/
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using System.Data;
public class TodoApiController : ApiController
{
private BetterMobileSpaContext db = new BetterMobileSpaContext();
// GET /api/todoapi
@siddharth-pandey
siddharth-pandey / gist:6087500
Created July 26, 2013 09:21
image replacement css and html. works even if CSS and Image is off in browser settinngs.
#HTML
<h1 class="technique-eight">
<span></span>CSS-Tricks
</h1>
#CSS
h1.technique-eight {
width: 350px; height: 75px;
position: relative;
}
@siddharth-pandey
siddharth-pandey / gist:5919577
Created July 3, 2013 15:45
jquery ui dialog, asp.net mvc
@section scripts {
@*<script src="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"></script>*@
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
@*use the below code to hide the close button*@
@*open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); }*@
<script type="text/javascript">
$(document).ready(function () {
if ($("#DisplaySelectedVehicle").text() !== " ") {
page inspector
less/coffee editor
web essentials
vs 2012.2
async downloasstringtaskasync
enable-migrations in packagemanager console to sync model props with database
add-migration initial
update-database
swipe left content not page
@siddharth-pandey
siddharth-pandey / gist:5815139
Created June 19, 2013 15:18
This redirects to another page if javascript is disabled without having to call functions, hide/show divs and worry about the flash of the DOM updating.
<noscript>
<meta http-equiv="refresh" content="0;URL=http://yoursite.com/noJavascript" />
</noscript>
Hello,
I can do this work for you as I have made many wordpress websites and helped many of my clients to make and improve their online presence.
However, I would like to know are you using separate WordPress installation or enable multisite option for your subdomain.
If you want you can check my linkedin profile by using the link below.
Let me know about what you think and we can start to crack on!
Hello,
I can do this work for you as I have done same work for many other clients. Also, I think I have the required experience for this kind of work as I am Microsoft Certified Professional in HTML5, CSS3 and JavaScript.
If you want you can check my linkedin profile by using the link below.
I am a hybrid developer as I work front-end with web and mobile UI as well as back-end that includes ASP.Net forms using C#, MVC, PHP, Java, Android, iOS, Phonegap,etc.
Let me know about what you think and we can start to crack on!
Regards