Skip to content

Instantly share code, notes, and snippets.

View lnickers2004's full-sized avatar

Larry Nickerson lnickers2004

View GitHub Profile
@lnickers2004
lnickers2004 / JSONP.js
Created September 10, 2013 07:33 — forked from icodeforlove/JSONP.js
JSONP: jsonp request in plain vanilla javascript
/**
* simple JSONP support
*
* JSONP.get('https://api.github.com/gists/1431613', function (data) { console.log(data); });
* JSONP.get('https://api.github.com/gists/1431613', {}, function (data) { console.log(data); });
*
* gist: https://gist.github.com/gists/1431613
*/
var JSONP = (function (document) {
var requests = 0,
@lnickers2004
lnickers2004 / Auction.cshtml
Created September 25, 2013 18:43 — forked from Maarten88/Auction.cshtml
SignalR: example with Bootstap 2, knockout.js javascript and jQuery
@{
ViewBag.Title = "SignalR Auction";
}
<div class="row-fluid"">
<div class="page-header">
<h1>
<strong data-bind="text: Title"></strong>
<small data-bind="text: Info"></small>
</h1>
@lnickers2004
lnickers2004 / DelegatingActionDescriptor.cs
Created December 10, 2013 00:23 — forked from MikeJansen/DelegatingActionDescriptor.cs
CORS and JSONP for Web Api The Old complicated WebApi 1.0 way of doing CORS and JSONP. Have a look at the awesome support for it in WebApi2.0 NOTE: webapi 2 is better so you don't have to jump through as many hoops as this. Hats off to the original developer that figured this out.
namespace Radar.Common.WebServer.Api.Controllers
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
@lnickers2004
lnickers2004 / Global.asax.cs
Created December 10, 2013 00:46 — forked from rdingwall/Global.asax.cs
CamelCase JSON: ASP.Net JSON camel case formatter for both WebApi and ASP.Net MVC
...
var config = GlobalConfiguration.Configuration;
// Replace the default JsonFormatter with our custom one
var index = config.Formatters.IndexOf(config.Formatters.JsonFormatter);
config.Formatters[index] = new JsonCamelCaseFormatter();
...
@lnickers2004
lnickers2004 / abc.txt
Created January 4, 2014 22:40 — forked from markrendle/abc.txt
Angular.JS: Visual Studio 2012 Intellisense setup
1. Back up C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\schemas\html\commonHTML5Types.xsd
2. Delete C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\schemas\html\commonHTML5Types.bin if it exists
3. Replace it with the file below.
4. Restart Visual Studio 2012.
@lnickers2004
lnickers2004 / Contact.html
Created January 10, 2014 22:48
Wiring Up a Pick Button in Bootstrap 3-- using jquery-- to handle changing button text. This functionality could be put into an Angular.js directive NOTE: this coede use an IIFE -- self execting anonymous funtion to protect the global scope
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Metro Golf Mobile</title>
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/mgm-bootstrap.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
</head>
@lnickers2004
lnickers2004 / gist:8364240
Last active January 2, 2016 21:29
Javascript Pattern: Self executing anonymous function to protect global scope
//using this pattern protects the global scope from vars defined inside
(function () {
//self executing anaonymous function
"use strict"
})();
@lnickers2004
lnickers2004 / gist:8364269
Last active January 2, 2016 21:29
Angular.js: Promise hander for angular.js $http method calls
//then promis handler to tack onto an $http call...
.then(function(){
//success
},
function(){
//error
});
@lnickers2004
lnickers2004 / dropdown-snippet.html
Last active January 2, 2016 21:38
Bootstrap3: Drop Down list example with jquery code to change button text
<div class="dropdown">
<button id="pickButton" class="btn btn-success">Pick One...</button>
<button class="btn btn-success" data-toggle="dropdown"><span class="caret"></span></button>
<ul id="reasonDropdown" class="dropdown-menu">
<li><a href="#" tabindex="-1">Reason</a></li>
<li><a href="#" tabindex="-1">Ordering a White Russian</a></li>
<li><a href="#" tabindex="-1">Complaint</a></li>
<li><a href="#" tabindex="-1">I am lost</a></li>
</ul>
@lnickers2004
lnickers2004 / gist:8364355
Created January 10, 2014 23:00
Bootstrap3: Radio Buttons
<!--alternative to radio buttons-->
<div class="btn-group btn-group-sm btn" data-toggle="buttons">
<label class="btn btn-success">
<input type="radio" name="Favorite" value=" " />Dude</label>
<label class="btn btn-success">
<input type="radio" name="Favorite" value=" " />Donny</label>
<label class="btn btn-success">
<input type="radio" name="Favorite" value=" " />Maude</label>
</div>