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.
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
| // Not tested, but the main gist of glueing ampersand state and react components together well. The actual mixin I use in production is slightly more eleborate (handling the stopping of listening and rebinding through the component's lifecycle), but the main idea is there. | |
| var Events = require('backbone-events-standalone'), | |
| React = require('react'), | |
| State = require('ampersand-state'); | |
| var PostModel = State.extend({ | |
| props: { | |
| title: 'string', | |
| body: 'string' |
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 Firebase = require('firebase'); | |
| var baseRef = new Firebase('https://my-firebase.firebaseio.com'); | |
| function getSnapshotValue(snapshot) { | |
| return snapshot.val(); | |
| } | |
| /** | |
| * A mixin for components that want to bind the value of a state variable | |
| * to the value at a Firebase ref. |
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 () { | |
| var makeCallback = function(eventType, observer) { | |
| if (eventType === 'value') { | |
| return function(snap) { | |
| observer.onNext(snap); | |
| }; | |
| } else { | |
| return function(snap, prevName) { | |
| // Wrap into an object, since we can only pass one argument through. | |
| observer.onNext({snapshot: snap, prevName: prevName}); |
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 httpProxy = require('http-proxy'), | |
| staticDir = 'app', | |
| apiHost = '<Your API Host>', | |
| apiPort = 80, | |
| apiPath = '/api'; | |
| var proxy = new httpProxy.RoutingProxy(); | |
| connect() | |
| .use(connect.logger("dev")) | |
| .use(function (req, res, next) { |
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
| #!/bin/sh | |
| set -e | |
| LIST=$1; | |
| DUE=$2; | |
| WUNDERLISTDB="$HOME/Library/Containers/com.wunderkinder.wunderlistdesktop/Data/Library/Application Support/Wunderlist/WKModel.sqlite" | |
| if [ "$LIST" == 'Inbox' ]; then | |
| LID="AND ZTASKLIST is null"; |
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
| before: | |
| command: rbenv install 1.9.3-p362 | |
| output: ruby-build: definition not found: 1.9.3-p362 | |
| hack: | |
| command: brew unlink ruby-build | |
| output: Unlinking /usr/local/Cellar/ruby-build/20121120... 4 links removed | |
| command: brew update |
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
| # | |
| # blob : Object from MongoDB | |
| # | |
| # blob.body: Buffer | |
| # blob.size: length of buffer, substitute for blob.body.length | |
| # blob.type: MIME (Eg. audio/x-wav) | |
| # | |
| # req : Object from http | |
| # res : Object from http | |
| # _ : Object from underscore |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.
# Ensure system is in ship-shape.
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev