<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
#!/bin/bash | |
# zip up all the files in the current directory | |
if [ $1 ]; then | |
echo "Creating $1.oex" | |
zip -r $1.zip . | |
# rename the .zip file to an .oex file | |
mv $1.zip $1.oex |
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential | |
apt-get -y install git-core | |
# Install rbenv | |
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
# Add rbenv to the path: |
var fs = require('fs'), | |
util = require('util'), | |
Stream = require('stream').Stream; | |
/** | |
* Create a bandwidth limited stream | |
* | |
* This is a read+writeable stream that can limit how fast it | |
* is written onto by emitting pause and resume events to | |
* maintain a specified bandwidth limit, that limit can |
!!! 5 | |
html | |
head | |
h1 My Site | |
block scripts | |
script(src="/jquery.js") | |
body | |
block header | |
header | |
p some header content |
if (Meteor.is_client) { | |
var Router = Backbone.Router.extend({ | |
routes: { | |
"" : "main", | |
":page": "main" //this will be http://your_domain/ | |
}, | |
main: function(page) { | |
document.body.innerHTML = ""; | |
page = page?page:"index"; | |
var frag = Meteor.ui.render(function () { |
var parent = function() { | |
var spawn = require('child_process').spawn; | |
var child = spawn(process.execPath, [process.argv[1], 123]); | |
var stdout = ''; | |
var stderr = ''; | |
child.stdout.on('data', function(buf) { | |
console.log('[STR] stdout "%s"', String(buf)); | |
stdout += buf; | |
}); | |
child.stderr.on('data', function(buf) { |
From Meteor's documentation:
In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.
This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.
Sometimes we need to run async code in Meteor.methods
. For this we create a Future
to block until the async code has finished. This pattern can be seen all over Meteor's own codebase:
Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
Meteor.startup(function() { | |
// check twitter authorize | |
var config = Accounts.loginServiceConfiguration.findOne({service: "twitter"}); | |
if(!config) { | |
Accounts.loginServiceConfiguration.insert({ | |
service: "twitter", | |
consumerKey: "YOUR_APP_CONSUMER_KEY", | |
secret: "YOUR_APP_CONSUMER_SECRET" | |
}); | |
}; |