a collection of useful commands to use Git and GitHub.
git add <file> --patch
# working example
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.
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.
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:
# /etc/network/interfaces | |
# | |
auto lo | |
iface lo inet loopback | |
# device: eth0 | |
iface eth0 inet manual | |
# IPv4 bridge | |
# (connect ONLY your firewall/router KVM instance here, this is the WAN device!) |
[ [ 'rule', 'parse upload' ], | |
[ 'indent' ], | |
[ 'rule', 'with all images' ], | |
[ 'indent' ], | |
[ 'rule', 'scale image to 800x600' ], | |
[ 'rule', 'save image to disk' ], | |
[ 'rule', 'save image to gridfs' ], | |
[ 'outdent' ], | |
[ 'outdent' ], | |
[ 'eos' ] ] |
module BootstrapPaginationHelper | |
class LinkRenderer < WillPaginate::ActionView::LinkRenderer | |
protected | |
def page_number(page) | |
unless page == current_page | |
link(page, page, :rel => rel_value(page)) | |
else | |
link(page, "#", :class => 'active') | |
end |
<VirtualHost *:80> | |
ServerAdmin default | |
ServerName nodejs.localhost | |
ProxyPass / balancer://ourexamplecluster | |
ProxyPassReverse / balancer://ourexamplecluster | |
<proxy balancer://ourexamplecluster ourexamplecluster=""> | |
BalancerMember http://127.0.0.1:8000 | |
</proxy> | |
</virtualhost> |
example | |
appkey.c | |
login.c |
# Copy this file in RAILS_ROOT/config/initializers/awesome_nested_set_helper.rb | |
module CollectiveIdea::Acts::NestedSet::Helper | |
# Like #nested_set_options helper but with only one DB query | |
# | |
# Returns options for select. | |
# You can exclude some items from the tree. | |
# You can pass a block receiving an item and returning the string displayed in the select. | |
# | |
# == Params |