This file contains hidden or 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 setPresence (whereAt) { | |
Meteor.Presence.state = function() { | |
return { | |
online : true, | |
whereAt: whereAt | |
} | |
} | |
} | |
function trackPageview (path) { |
This file contains hidden or 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
# coding=UTF-8 | |
from __future__ import division | |
import re | |
# This is a naive text summarization algorithm | |
# Created by Shlomi Babluki | |
# April, 2013 | |
class SummaryTool(object): |
This file contains hidden or 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="layout"> | |
{{yield 'header'}} | |
{{yield 'base'}} | |
<div class="content" id="content"> | |
<div id="main-content"> | |
{{yield 'mainContent'}} |
This file contains hidden or 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.users.update({ _id: userID}, { | |
$set: { | |
createdAt: new Date() | |
} | |
}, false, true, function(err, result){ | |
if(err) | |
console.log(err); | |
}); |
This file contains hidden or 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
MyController = RouteController.extend({ | |
before: function () { | |
var onReady = function () { | |
if (/* whatever */) | |
this.render(); | |
}; | |
var onWait = function () { | |
// maybe show a loading or logging in function. | |
}; |
This file contains hidden or 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 create_token(): | |
message = bytes("Message") | |
secret = bytes("secret") | |
signature = base64.b64encode(hmac.new(secret, message, digestmod=hashlib.sha256).digest()); | |
print(signature) |
This file contains hidden or 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
Deps.autorun(function () { | |
var current = Router.current(); | |
Deps.afterFlush(function () { | |
$('.content-inner').scrollTop(0); | |
$(window).scrollTop(0); | |
}); | |
}); | |
This file contains hidden or 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
this.route('/', { | |
before: function() { | |
if(!Meteor.loggingIn() && !Meteor.user()) { | |
this.redirect("login"); | |
} | |
} | |
}); |
This file contains hidden or 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
/** | |
* | |
* @param chargeId | |
*/ | |
refundChargeById: function (chargeId) { | |
var amount = 300; // this causes an undefined params error even though the underlying method doesn't expect {} | |
stripe.charges.refund(chargeId, amount, | |
function (err, refund) { |
This file contains hidden or 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 amount = Math.abs(invoice.total); | |
stripe.charges.refund(charge.data[0].id, amount, | |
function (err, refund) { | |
)}; |