Skip to content

Instantly share code, notes, and snippets.

View benjamine's full-sized avatar

Benjamín Eidelman benjamine

View GitHub Profile
@benjamine
benjamine / README.mdown
Created May 30, 2011 16:04 — forked from mathewbyrne/README.mdown
An asynchronous method for embedding gists in an HTML document using jQuery.

A quick jQuery plugin for asynchronously embedding a gist in an HTML document.

There are a couple of ways to use it. The simpler way is replacing all Gist links in document by their embedded version:

<script>$($.gist);</script>

All links that point to a gist, or gist file will be replaced by the corresponding embedded gist, or gist file.

Gist link replacement can also be called on a container element:

@benjamine
benjamine / runwebservicetest.bat
Created May 9, 2011 16:58
Call WebService with JSON data using MSXML2.ServerXMLHTTP (Windows Script)
Cscript webservicetest.js
pause
@benjamine
benjamine / gist:822331
Created February 11, 2011 13:25
JavaScript Koan (liammclennans) step 1
// part of https://github.com/liammclennan/JavaScript-Koans
$(document).ready(function () {
module("About Asserts (topics/about_asserts.js)");
test("ok", function () {
ok(true, 'what will satisfy the ok assertion?');
});
@benjamine
benjamine / scrumy-rest-api-sample.js
Created September 2, 2010 02:37
Accessing scrumy.com REST API with jquery
var scrumyname = $.trim($('#scrumyname')[0].value);
var usrpwd64 = base64.encode(scrumyname + ':' + $('#scrumypwd')[0].value);
var currenturl = 'http://scrumy.com/api/scrumies/' + scrumyname + '/sprints/current.json';
alert('accessing ' + currenturl);
$.ajax({
url: currenturl,
beforeSend: function(req) {
req.setRequestHeader("Origin", document.location.protocol + "//" + document.location.host);
req.setRequestHeader("Authorization", "Basic " + usrpwd64);