Skip to content

Instantly share code, notes, and snippets.

View MarkBorcherding's full-sized avatar

Mark Borcherding MarkBorcherding

  • World Wide Technology
  • St Louis, MO
View GitHub Profile
@MarkBorcherding
MarkBorcherding / rspec-syntax-cheat-sheet.rb
Created April 18, 2012 20:29 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@MarkBorcherding
MarkBorcherding / url2png-example.php
Created November 16, 2011 20:37 — forked from url2png/url2png-example-c-sharp
Example usage of url2png.com automated screenshot API
/* ## # #
# # #######
# # #
# #######
# # # #
# */
private static string url2png_apikey { get { return "<APIKEY>"; } }
private static string url2png_secret { get { return "<SECRET>"; } }
// jQuery barfs because $(empty).data("autocomplete") => undefined
$(".course-autocomplete").autocomplete({
source: "/courses/autocomplete.json"
}).data("autocomplete")._renderItem = function(ul, item) {
return $("<li>")
.data("item.autocomplete", item)
.append("<a>" + item.name + "</a>")
.appendTo(ul);
};
// jQuery barfs because $(empty).data("autocomplete") => undefined
$(".course-autocomplete").autocomplete({
source: "/courses/autocomplete.json"
}).each(function(i,v){
v.data("autocomplete")._renderItem = function(ul, item) {
return $("<li>")
.data("item.autocomplete", item)
.append("<a>" + item.name + "</a>")
.appendTo(ul);
};