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
Meteor.Router.add({ | |
'/': 'postsList', | |
'/posts/:_id': { | |
to: 'postPage', | |
and: function(id) { | |
Session.set('currentPostId', id); | |
} | |
} | |
}); |
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
<template name="postItem"> | |
<div class="post"> | |
<div class="post-content"> | |
<h3><a href="{{url}}">{{title}}</a><span>{{domain}}</span></h3> | |
</div> | |
<a href="{{postPagePath this}}" class="discuss btn">Discuss</a> | |
</div> | |
</template> |
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
def get_submission_score(score, memory_taken, time_taken, category): | |
""" | |
@param score: the score which is received by test-cases | |
@param memory_taken: memory taken by submission | |
@param time_taken: time taken by submission | |
@param category: Easy(1)/Moderate(2)/Hard(3) | |
""" | |
total_max = { | |
1: 35, # max 35 points for Easy challenge |
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
<html> | |
<head> | |
<style> | |
.imageList img { | |
transition: opacity 2s ease; | |
} | |
.imageList img.inactive { | |
opacity: 0; |
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 ancestryOfAttributes = function(targetNode){ | |
result = []; | |
while(targetNode.parentNode){ | |
var attrs = []; | |
for(var i=0; i<targetNode.attributes.length; i++){ attrs.push(targetNode.attributes[i].nodeName); } | |
result.unshift(attrs.join(",")); | |
targetNode = targetNode.parentNode | |
} | |
return JSON.stringify(result, undefined, 4); | |
}; |
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
FYI - For Your Information. | |
I just want to add a useful comment to your pull request. | |
There's no need to make changes right now. | |
This comment is not blocking a merge of this PR from happening. |
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
//synchronous behaviour testing | |
var async = require('async'); | |
var request = require('request'); | |
function async_function(){ | |
} | |
function sync_function(){ | |
var result = "5"; |
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'); | |
var request = require('request'); | |
var samplePayload = { | |
"key1":{ | |
"key1.1": { | |
"key1.1.1": ["val1.1.1.1", "val1.1.1.2", "val1.1.1.3", "val1.1.1.4"] | |
}, | |
"key1.2": ["val1.2.1" ,"val1.2.2"] | |
}, |
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 currentDoc = jsdom.jsdom('<html><head><title>href test</title></head><body><p><a href="test.html">Test</a></p></body></html>';, null, {}); | |
var window = currentDoc.createWindow(); | |
jsdom.jQueryify(window, 'jquery-1.4.2.min.js' , function() { | |
console.log(window.$('a')[0]['href']); | |
}); | |
/* | |
returns /Users/[path to the script]/test.html | |
*/ |
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
//clothe a hub file that has 'naked' expressions | |
//e.g. turn {key:$('body p')} into {key:"$('body p')"} | |
function clothe(contents){ | |
closers = /[\}\]\)\/"']/ | |
openers = /[\{\[\(\/"']/ | |
closing = { | |
"{": "}", | |
"[": "]", | |
"(": ")", |
OlderNewer