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.subscribe("markers"); | |
//will, in theory, run everytime Markers.find() changes | |
Deps.autorun(function() { | |
console.log("grabbed " + Markers.find().count() + " markers"); | |
Markers.find().forEach(function (marker) { | |
var geoJSON = { type: "FeatureCollection", features: [ marker ]}; | |
L.mapbox.markerLayer(geoJSON, { | |
detectRetina: true, | |
}).addTo(map); |
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.publish(null, function() { | |
return Meteor.users.find({_id: this.userId}, {fields: {username: 1, emails: 1, profile: 1, admin: 1}}); | |
}); |
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.methods({ | |
btce: function(to) { | |
var str = ''; | |
Meteor.http.get('https://btc-e.com/api/2/btc_usd/ticker', function(error, response) { | |
if (response.statusCode === 200) { | |
var data = response.content; | |
data = JSON.parse(data); | |
if(data.ticker) { | |
return ("BTC-E: BTC->USD: [" + data.ticker.avg + "]"); | |
} |
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
coinbase: function(to) { | |
Meteor.http.get('https://coinbase.com/api/v1/prices/buy', function(error, response) { | |
if (response.statusCode === 200) { | |
var data = response.data; | |
if(data.currency) { | |
Bot.say(to, 'Coinbase BTC: ' + data.amount + ' ' + data.currency); | |
} | |
} | |
}); | |
} |
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
client.addListener('message', Meteor.bindEnvironment(function(handle, to, message) { | |
//insert irc message into db | |
Messages.insert({ | |
handle: handle, | |
room_id: to, | |
message: message, | |
date_time: new Date(), | |
action: false, | |
irc: true, | |
bot: false |
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.publish(null, function () { | |
return Meteor.users.find({_id: this.userId}, {fields: {username: 1, profile: 1, role: 1}}); | |
}); |
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
<body> | |
{{>body}} | |
</body> | |
<template name="body"> | |
{{renderPage layoutName}} | |
</template> | |
<template name="adminLayout"> | |
{{>adminHeader}} |
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 path = Npm.require("path"); | |
var base = path.resolve('.'); | |
if (base == '/'){ | |
base = path.dirname(global.require.main.filename); | |
} | |
var publicPath = path.resolve(base+'/public/'); | |
var staticPath = path.resolve(base+'/static/'); |
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="items"> | |
<ul> | |
{{#each items}} | |
<li> | |
{{>itemlist}} | |
</li> | |
{{/if}} | |
</ul> | |
</template> |
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
Fiber(function() { | |
Messages.insert({ | |
handle: handle | |
}); | |
processMessage(handle, message); | |
}).run(); |
NewerOlder