Skip to content

Instantly share code, notes, and snippets.

<form id="searchBox" action="/search" method="get" >
<input placeholder="Search spots" id="q" name="q" type="search" autofocus >
</form>
<h3>Search Results for </h3>
<ul id="searchResults">
<% if(@is_search_empty) %>
{ favorited: false,
text: 'RT @kimmaicutler: Android platform\'s 1st billion installs took 20 months, 2nd billion took 5 months, 3rd billion took only 2 months. htt ...',
retweet_count: 0,
in_reply_to_screen_name: null,
in_reply_to_status_id_str: null,
place: null,
contributors: null,
retweeted: false,
in_reply_to_user_id: null,
source: '<a href="http://itunes.apple.com/us/app/twitter/id409789998?mt=12" rel="nofollow">Twitter for Mac</a>',
var index = 0;
results = [],
prevLen;
while(true) {
r.albums[index] && results.push(r.albums[index]);
r.tracks[index] && results.push(r.tracks[index]);
r.artists[index] && results.push(r.artists[index]);
if(prevLen == results.length || results.length >= 9) {
@kaareal
kaareal / gist:986743
Created May 23, 2011 14:06
promise vs seq
RealtimeSync.prototype._storeDirectMessage = function(message, user, callback) {
var messageDate = new Date(Date.parse(message.created_at)),
b = user.user_id, privateMsg;
if(!user.dm_latest_d) {
user.dm_latest_d = new Date(0);
}
if(messageDate < user.dm_latest_d) {
return;
navigator.plugins
[
{
"name": "Shockwave Flash",
"filename": "Flash Player.plugin",
"description": "Shockwave Flash 10.2 r159"
},
{
"name": "Silverlight Plug-In",
@kaareal
kaareal / less-middleware
Created April 15, 2012 16:02
Less middleware for compiling less files that working nicely with @import and updates when you change the imported files
/*!
* Lifted from https://github.com/LearnBoost/stylus/blob/master/lib/middleware.js
* Refactored to work with less instead of stylus and invoking compile when you change a "@import file"
*/
/*!
* Stylus - middleware
* Copyright(c) 2010 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
@kaareal
kaareal / solution.js
Created April 20, 2012 12:56 — forked from datafatmunger/solution.js
Solution Backbone Model
Solution = Backbone.Model.extend ({
fetchAll: function(options) {
var solution = this;
var error = false;
var errorHandler = function() {
error = true;
}
$.when(solution.comments.fetch({ error: errorHandler }),
solution.likes.fetch({ error: errorHandler }),
info: Welcome to Nodejitsu kaareal
info: It worked if it ends with Nodejitsu ok
info: Executing command logs app
info: Attempting to load logs for /Users/kaareal/Code/closeterie/package.json
error: Error running command logs app
error: Nodejitsu Error (500): Internal Server Error
warn: Error returned from Nodejitsu
error: Error: socket hang up
error: at createHangUpError (http.js:1124:15)
Kaare-Larsens-MacBook-Pro:closeterie kaareal$ sudo npm install jitsu -g
Password:
npm http GET https://registry.npmjs.org/jitsu
npm http 304 https://registry.npmjs.org/jitsu
npm http GET https://registry.npmjs.org/colors/0.6.0-1
npm http GET https://registry.npmjs.org/complete/0.3.1
npm http GET https://registry.npmjs.org/dateformat/1.0.2-1.2.3
npm http GET https://registry.npmjs.org/flatiron/0.2.5
npm http GET https://registry.npmjs.org/flatiron-cli-users/0.1.1
npm http GET https://registry.npmjs.org/flatiron-cli-config/0.1.3
@kaareal
kaareal / gist:3347583
Created August 14, 2012 08:43
Error running command deploy
Kaare-Larsens-MacBook-Pro:closeterie kaareal$ jitsu deploy
info: Welcome to Nodejitsu kaareal
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in server.js
info: Checking app availability findus
info: Creating app findus
info: Creating snapshot 0.1.50
info: Updating app findus
info: Activating snapshot 0.1.50 for findus