made with esnextbin
made with esnextbin
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
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
const React = require('react') | |
const tuku = require('tuku') | |
const router = require('tuku/router') |
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
/** | |
* Due to RequireBin's bug https://github.com/maxogden/requirebin/issues/110, | |
* please add `<div id="root"></div>` to the `<body>`. | |
* Then hit Run Code when it's green. | |
*/ | |
require('babel-polyfill') | |
const React = require('react') | |
const ReactDOM = require('react-dom') | |
const tuku = require('tuku').default |
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
sudo apt-get update | |
sudo apt-get install python-virtualenv libxslt1-dev libxml2 | |
sudo apt-get install python-dev | |
sudo apt-get install postgresql | |
sudo apt-get install postgresql-server-dev-9.3 | |
sudo apt-get install redis-server | |
sudo -u postgres createuser -s sentry | |
sudo -u postgres psql -c "alter user sentry with password 'sentry';" |
假设有个 API /articles
返回的结构如下:
articles: article*
article: {
author: user,
likers: user*
primary_collection: collection?
collections: collection*
}
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
app.directive('ngEnter', function() { | |
return function(scope, element, attrs) { | |
element.bind("keydown keypress", function(event) { | |
if(event.which === 13) { | |
scope.$apply(function(){ | |
scope.$eval(attrs.ngEnter); | |
}); | |
event.preventDefault(); | |
} |