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
users = new Meteor.Collection('Users'); | |
Meteor.startup -> | |
Iconv = Meteor.require('iconv').Iconv | |
userIds = '53882537:128' | |
userInfo = HTTP.get( | |
'http://search.baihe.com/mystruts/userInfo.action', | |
{ | |
params: {userIds: userIds} | |
headers: {"Content-Type": "application/json; charset=utf-8"} | |
} |
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
put.on('progress',function(progress){ | |
// Update SOMETHING with the progress data | |
Meteor.bindEnvironment(function(){ | |
S3files.update({file_name: file.name}, {$set: {percent_uploaded: progress.percent}}); | |
},function(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
Template.s3progress.helpers({ | |
progress: function () { | |
var file_name = Session.get('s3-file-name') | |
console.log(file_name); | |
if(file_name != null){ | |
var file = S3files.findOne({file_name: file_name}); | |
if(file){ | |
console.log(file); | |
var percent = file.percent_uploaded | |
if(percent) |
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
Knox = Npm.require("knox"); | |
var Future = Npm.require('fibers/future'); | |
var streamBuffers = Npm.require("stream-buffers"); | |
var knox; | |
var S3; | |
Meteor.publish('s3files', function(){ | |
return S3files.find({user: this.userId}) |
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
server { | |
listen 80; | |
server_name www.example.com; | |
# $scheme will get the http protocol | |
# and 301 is best practice for tablet, phone, desktop and seo | |
# return 301 $scheme://example.com$request_uri; | |
# We want to redirect people to the https site when they come to the http site. | |
return 301 https://example.com$request_uri; | |
} |
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
class @AuthorizedController extends RouteController | |
before: -> | |
console.log 'AuthorizedController :before action' | |
if not Meteor.user()? | |
@redirect 'salesLanding' |
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
@Lexicon = new Meteor.Collection "lexicon" | |
if Meteor.isClient | |
Template.language_dropdown.rendered = -> | |
Lexicon.distinct "lang", (err, res) => | |
$("#langs").autocomplete {source: res} |
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
@Lexicon = new Meteor.Collection "lexicon" | |
@Langs = new Meteor.Collection(null) | |
if Meteor.isServer | |
for lang in Lexicon.distinct('lang') | |
Langs.insert lang | |
Meteor.publish 'lexicon', () -> | |
return Lexicon.find() |
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
@Lexicon = new Meteor.Collection "lexicon" | |
if Meteor.isServer | |
Meteor.methods | |
Langs: -> Lexicon.distinct('lang') | |
if Meteor.isClient | |
Meteor.call 'Langs', (err, res) -> | |
console.log res |
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
[digilord@Io meteor-weak-dependency-test[master]]$ meteor | |
[[[[[ ~/projects/meteor-weak-dependency-test ]]]]] | |
=> Errors prevented startup: | |
While building package `weak-test`: | |
error: no such package: 'iron-router' | |
=> Your application has errors. Waiting for file change. |