Skip to content

Instantly share code, notes, and snippets.

@DeanPoulin
DeanPoulin / jquery-jquery-jquery-oh-my.js
Created April 14, 2021 05:45
jQuery That Needs Some Help
// 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);
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 October 24, 2018 04:43
HTTP Request with XML Namespace
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>
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
@DeanPoulin
DeanPoulin / iphone-post.txt
Created October 24, 2018 04:35
XML HTTP Post
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>
@DeanPoulin
DeanPoulin / UsersService.cs
Created October 24, 2018 04:29
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 September 27, 2018 23:10 — forked from jakebathman/StateBoundaries.sql
The approximate max/min latitude and longitude for all states and major territories
-- 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;
public interface UsersService {
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "users",
RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Bare)]
CreateUserStatus CreateUser(WebUser user);
}
{
"test": true
}
@DeanPoulin
DeanPoulin / panel-list-groups.html
Created January 20, 2014 18:21
Panel List Groups
<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>