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
// $(fn) shorthand for $(document).ready(fn) | |
$(function() { | |
// Hover is a handy $ function that takes two functions, the first for when the mouse goes in and the other for when it goes out | |
$('.navcontainer li').hover(function() { | |
// this in a $ event handler will refer to the element raising the event | |
$('.' + this.id).addClass('thecolor'); | |
}, function() { | |
$('.' + this.id).removeClass('thecolor'); | |
}); | |
}); |
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
describe "when doing something", -> | |
it "should do something else", -> | |
expect(something).toEqual 42 |
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
Gay | |
Golf | |
IMAX | |
Iran | |
LOGO | |
Math | |
Pets | |
Pop | |
Yoga |
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
yepnope([ | |
{ | |
load: 'http://code.jquery.com/jquery-1.4.3.min.js', | |
callback: function(){} | |
}, | |
{ | |
test: Modernizr.input.placeholder, | |
nope: 'js/jquery.placeholder.js', | |
callback: function(inc, testResult) { | |
$('input, textarea').placeholder(); |
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
void Main() | |
{ | |
var testMock = new Mock<Test>(); | |
testMock.SetupGet(m => m.IsSomething).Returns(true); | |
var test = testMock.Object; | |
Debug.Assert(test.IsSomethingTrue); | |
} | |
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
var http = require('http'), | |
parse = require('url').parse, | |
spawn = require('child_process').spawn; | |
this.server = http.createServer(function(request, response){ | |
var url = parse(request.url, true), | |
convert = spawn('convert', ['chart.svg', 'png:-']); | |
response.writeHeader(200, {'Content-Type': 'image/png'}); | |
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
(function($) { | |
ProvenWorks.IndustryComplete.StaggeredEvent = function(method, options) { | |
var self = this; | |
var timerId; | |
var method = method; | |
var settings = $.extend({ | |
delay: 200 | |
}, options); | |
self.trigger = function() { |
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
if (typeof(ProvenWorks) === 'undefined') var ProvenWorks = {}; | |
(function($) { | |
ProvenWorks.IndustryComplete = new function() { | |
var self = this; | |
function buttonClicked() { | |
alert("You've clicked a button!"); | |
}; |
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
void Main() | |
{ | |
Person pete = new PersonFactory().GetPerson(1); | |
Console.WriteLine(pete.Name); | |
} | |
public class Person | |
{ | |
public virtual int Id { get; protected set; } |
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
void Main() | |
{ | |
var name = new LazyValue<string>(LoadName); // Technically you don't even need the generic specification here but I'm being verbose | |
Console.WriteLine(name.Value); | |
} | |
private static string LoadName() | |
{ | |
return "Pete Smith"; |
NewerOlder