Skip to content

Instantly share code, notes, and snippets.

View jquery-jquery-jquery-oh-my.js
// Here's some jQuery/javascript that could use lots of help. This is NOT my code.
// This would be some great code to run through quick-lint-js
function hide_error(e,id){
e.preventDefault();
jQuery("input").attr("autocomplete","new-address");
jQuery('#'+id+'_error').addClass('hide_err').hide();
if(id=="enter_address"){
jQuery("#selectUnit").val(0);
View fixed-http-response.txt
HTTP/1.1 200 OK
Connection: close
Date: Fri, 20 Nov 2009 02:51:10 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-Aspnet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/xml; charset=utf-8
Content-Length: 242
@DeanPoulin
DeanPoulin / fixed-http-request.txt
Created Oct 24, 2018
HTTP Request with XML Namespace
View fixed-http-request.txt
POST /IPhoneDataService.svc/users HTTP/1.1
Content-Type: text/xml
Accept: application/xml
User-Agent: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3
<?xml version="1.0" encoding="utf-8"?>
<WebUser
xmlns="http://development.svnanalytics.com/contracts"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Email>test2@test.com</Email>
View post-response.txt
HTTP/1.1 400 Bad Request
Connection: close
Date: Fri, 20 Nov 2009 03:36:50 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-Aspnet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/html
Content-Length: 2890
View iphone-post.txt
POST /IPhoneDataService.svc/users HTTP/1.1
Content-Type: text/xml
Accept: application/xml
User-Agent: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3
<?xml version=”1.0″ encoding=”utf-8″?>
<WebUser>
<Email>test2@test.com</Email>
<JoinDate>2009-11-19T18:04:02.9990737-05:00</JoinDate>
View UsersService.cs
public interface UsersService {
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "users",
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Bare)]
CreateUserStatus CreateUser(WebUser user);
}
@DeanPoulin
DeanPoulin / StateBoundaries.sql
Created Sep 27, 2018 — forked from jakebathman/StateBoundaries.sql
The approximate max/min latitude and longitude for all states and major territories
View StateBoundaries.sql
-- Create the table
CREATE TABLE IF NOT EXISTS `StateBoundaries` (
`State` varchar(10) DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
`MinLat` varchar(50) DEFAULT NULL,
`MaxLat` varchar(50) DEFAULT NULL,
`MinLon` varchar(50) DEFAULT NULL,
`MaxLon` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
View operation-contract.cs
public interface UsersService {
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "users",
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Bare)]
CreateUserStatus CreateUser(WebUser user);
}
View panel-list-groups.html
<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">Panel heading</div>
<div class="panel-body">
<p>...</p>
</div>
<!-- List group -->
<ul class="list-group">
<li class="list-group-item">Cras justo odio</li>