# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
find . -type f -print1 | xargs -0 sed -i '' 's/\[TestMethod\]/\[Test\]/g' | |
find . -type f -print0 | xargs -0 sed -i '' 's/\[TestMethod()\]/\[Test\]/g' | |
find . -type f -print0 | xargs -0 sed -i '' 's/\[TestClass\]/\[TestFixture\]/g' | |
find . -type f -print0 | xargs -0 sed -i '' 's/\[TestClass()\]/\[TestFixture\]/g' | |
find . -type f -print0 | xargs -0 sed -i '' 's/\[TestInitialize\]/\[SetUp\]/g' | |
find . -type f -print0 | xargs -0 sed -i '' 's/\[TestInitialize()\]/\[SetUp\]/g' | |
find . -type f -print0 | xargs -0 sed -i '' 's/\[TestCleanup\]/\[TearDown\]/g' | |
find . -type f -print0 | xargs -0 sed -i '' 's/\[TestCleanup()\]/\[TearDown\]/g' | |
find . -type f -print0 | xargs -0 sed -i '' 's/\[ClassInitialize\]/\[TestFixtureSetUp\]/g' | |
find . -type f -print0 | xargs -0 sed -i '' 's/\[ClassInitialize()\]/\[TestFixtureSetUp\]/g' |
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() { | |
$(document).ready(function() { | |
function saveTime(e, jqxhr, settings) { | |
settings.startTime = new Date().getTime(); | |
} | |
function registerTime(e, jqxhr, settings) { | |
_gaq.push(['_trackEvent', 'AjaxResponseTime', settings.type, settings.url.split('?')[0] ,(new Date().getTime() - settings.startTime), true]); |
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
app.get('/api/', function(req, res) { | |
// This endpoint | |
//returns the routes available in the api | |
var routes = []; | |
for(var verb in app.routes){ | |
app.routes[verb].forEach(function(route) { | |
var doc = route.callbacks[route.callbacks.length-1].toString().split('\n').filter(function(str) { | |
var doc = str.match(/(?:\s\/\/)(.*)/); | |
if(doc == null) return false; | |
return true; |
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
''' | |
Created on 16 apr 2010 | |
@author: Morten Nielsen | |
You may change this code as you see fit, but you are expected to provide a | |
reference back to the original author, Morten Nielsen. | |
http://www.morkeleb.com | |
''' |
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
<div class="dropdown"> | |
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true"> | |
<span data-bind="text: selection_size"/> <span data-bind="localize:'Client.Management.NumberOfTagsSelected'"/> | |
<span class="caret"></span> | |
</button> | |
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1" data-bind="foreach: sorted_values"> | |
<li role="presentation"><a data-bind="click: selection_changed"><input type=checkbox data-bind="checked: selected"/> <span data-bind="text: Title"></a></li> | |
</ul> | |
</div> |
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
require "github_api" | |
user = 'username' | |
token = 'oauth access token obtained from user settings' | |
organisation = 'myorg' | |
Github.configure do |c| | |
c.basic_auth = "#{user}:#{token}" | |
c.oauth_token = token |
I hereby claim:
- I am morkeleb on github.
- I am morkeleb (https://keybase.io/morkeleb) on keybase.
- I have a public key ASC2mT0F-yJJoeUbfiWksrY9sQI5m8olCQN0LK4ynNWwKwo
To claim this, I am signing this object:
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
sed -i '' 's/\.notToHaveBeenCalled/\.not\.toHaveBeenCalled/' spec/*.js spec/**/*.js | |
sed -i '' 's/\.calls\[0\]/\.calls\.first()/' spec/*.js spec/**/*.js | |
sed -i '' 's/\.calls\[1\]/\.calls\.all()\[1\]/' spec/*.js spec/**/*.js | |
sed -i '' 's/\.calls\.length/\.calls\.count()/' spec/*.js spec/**/*.js | |
sed -i '' 's/\.callCount/\.calls\.count()/' spec/*.js spec/**/*.js | |
sed -i '' 's/\.mostRecentCall/\.calls\.mostRecent()/' spec/*.js spec/**/*.js | |
sed -i '' 's/\.argsForCall\[0\]/\.calls\.first()\.args/' spec/*.js spec/**/*.js | |
sed -i '' 's/\.argsForCall\[1\]/\.calls\.all()\[1\]\.args/' spec/*.js spec/**/*.js | |
sed -i '' 's/\.argsForCall\[2\]/\.calls\.all()\[2\]\.args/' spec/*.js spec/**/*.js | |
sed -i '' 's/\.andCallFake/\.and\.callFake/' spec/*.js spec/**/*.js |