Skip to content

Instantly share code, notes, and snippets.

@cbushell
cbushell / gist:781681
Created January 16, 2011 09:59
Verifying constructor was called with Jasmine
describe('iPhone', function() {
it('should construct an instance of iphone analytics', function() {
spyOn(window, 'iPhoneAnalytics');
analytics.install();
expect(window.iPhoneAnalytics).toHaveBeenCalled();
});
});
@cbushell
cbushell / gist:771566
Created January 9, 2011 09:40
Include Bluprint css with haml
= stylesheet_link_tag 'blueprint-1.0/screen.css', :rel => 'stylesheet', :type => 'text/css', :media => 'screen, projection'
= stylesheet_link_tag 'blueprint-1.0/print.css', :rel => 'stylesheet', :type => 'text/css', :media => 'print'
<!--[if lt IE 8]>
= stylesheet_link_tag 'blueprint-1.0/ie.css', :rel => 'stylesheet', :type => 'text/css', :media => 'screen, projection'
<![endif]-->
@cbushell
cbushell / gist:719832
Created November 29, 2010 11:05
Twitter widget
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 6,
interval: 6000,
width: 'auto',
height: 300,
theme: {
@cbushell
cbushell / gist:709744
Created November 22, 2010 09:36
Embedding Flot image
<div id="all_builds" style="width: 800px; height: 600px; position: relative;"></div>
@cbushell
cbushell / gist:709705
Created November 22, 2010 09:06
Plotting build times with jQuery, Flot and DateJS
$(document).ready(
function() {
var builds = [
{ url: "/build_results/start",
legend: "Start"
}
];
$.each(builds, function(build_index, build) {
$.get(build.url, function(data) {