This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
jQuery outerHTML plugin with ownerDocument fix | |
See: http://www.briangrinstead.com/blog/jquery-outerhtml-snippet | |
Based off of: http://brandonaaron.net/blog/2007/06/17/jquery-snippets-outerhtml/ | |
*/ | |
$.fn.outerHTML = function() { | |
var doc = this[0] ? this[0].ownerDocument : document; | |
return $('<div>', doc).append(this.eq(0).clone()).html(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
http://lanitdev.wordpress.com/2009/06/08/extending-jquery-to-select-asp-controls/ | |
Enables $(":asp(id)") selector in jQuery for dealing with ASP Server IDs in JavaScript | |
Example: $(":asp(txtPhoneNumber)") | |
*/ | |
jQuery.expr[':'].asp = function(elem, i, match) { | |
return (elem.id && elem.id.match(match[3] + "$")); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript' src='astar.js'></script> | |
<script type='text/javascript'> | |
var graph = new Graph([ | |
[1,1,1,1], | |
[0,1,1,0], | |
[0,0,1,1] | |
]); | |
var start = graph.grid[0][0]; | |
var end = graph.grid[1][2]; | |
var result = astar.search(graph, start, end); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
An implementation of: http://javascriptweblog.wordpress.com/2010/11/29/json-and-jsonp/ | |
that handles multiple connections at once (don't want to replace the global callback if second | |
request is sent after the first, but returns before. | |
*/ | |
(function(global) { | |
var callbackCounter = 0; | |
var evalJSONP = function(callback) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
html,body {height:100%;margin:0;padding:0;} | |
#app { | |
height:100%; | |
display: -webkit-box; | |
-webkit-box-orient: vertical; | |
-webkit-box-align:stretch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implements multipart/form-data POST in C# http://www.ietf.org/rfc/rfc2388.txt | |
// http://www.briangrinstead.com/blog/multipart-form-post-in-c | |
public static class FormUpload | |
{ | |
private static readonly Encoding encoding = Encoding.UTF8; | |
public static HttpWebResponse MultipartFormDataPost(string postUrl, string userAgent, Dictionary<string, object> postParameters) | |
{ | |
string formDataBoundary = String.Format("----------{0:N}", Guid.NewGuid()); | |
string contentType = "multipart/form-data; boundary=" + formDataBoundary; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://docs.google.com/presentation/d/1Eyns40c5J6n2ep7NUMid7ipSuR-jATF1pdWQNuuwp-4/edit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For instance: http://paulgraham.com/growth.html | |
// Copy the following into devtools console, then you should see note contents when hovering the link | |
[].forEach.call(document.querySelectorAll("a[href*='#f']"), function(l) { | |
var to = document.querySelector('[name=' + l.href.split('#')[1] + ']'); | |
var text = ''; | |
while ((to = to.nextSibling) && to.tagName !== "A") { | |
text+= to.textContent.replace(/\n/g, ' ') + '\n'; | |
} | |
text = text.replace(/^\s*\]\s*/, '').replace(/\s*\[\s*/, '').replace(/\n{2,}/g, '\n\n'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a sizzle expression using jQuery 1.8 style and older style. | |
// This one returns elements which have an ID that ends with a string passed in. | |
// <div id="prefix_test"></div> | |
// $(":asp(test)") | |
if ($.expr.createPseudo) { | |
jQuery.expr[':'].asp = $.expr.createPseudo(function( id ) { | |
return function(elem) { | |
return elem.id && elem.id.match(id + "$") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Fix ownership on a directory | |
:: Download subinacl (if needed) at http://www.microsoft.com/en-us/download/details.aspx?id=23510 | |
C:\subinacl /file *.* /setowner=COMPUTER\Administrator | |
cacls *.* /G Administrator:F |
OlderNewer