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
| if [ ! -z "$IOJS" ] && [ "$IOJS" != "false" ]; then | |
| echo "Installing io.js v$IOJS ..." | |
| curl -s https://iojs.org/dist/v$IOJS/iojs-v$IOJS-linux-x64.tar.xz > iojs-v$IOJS-linux-x64.tar.xz | |
| tar xf iojs-v$IOJS-linux-x64.tar.xz | |
| export PATH="$(pwd)/iojs-v$IOJS-linux-x64/bin/:$PATH" | |
| echo "Installation successful" | |
| else | |
| echo "Using node..." | |
| fi |
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 dbAdmin = require('./db/admin.js'); | |
| var dbNormal = require('./db/normal.js'); | |
| var dbSomethingElse = require('./db/something-else.js'); |
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 Sequelize = require('sequelize') | |
| , sequelize = new Sequelize('sequelize_test', 'root') | |
| var User = sequelize.define('User', { | |
| username: Sequelize.STRING, | |
| password_hash: Sequelize.STRING | |
| }, { | |
| validate: { | |
| password: function(next) { | |
| if (((this._password || "").trim() !== '') && (this._password === this._password_confirmation)) { |
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 Sequelize = require('sequelize') | |
| , sequelize = new Sequelize('sequelize_test', 'root') | |
| var Manufacturer = sequelize.define('manufacturer', { | |
| name: Sequelize.STRING | |
| }); | |
| var GraphicsCard = sequelize.define("graphics_card", { | |
| model: Sequelize.STRING, | |
| RAM: Sequelize.INTEGER |
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
| fn get_path_to(target: & str, opt: Option<&str>) -> Path { | |
| let path: ~str = match target { | |
| "root" => { | |
| os::homedir().unwrap().to_str() + "/.rsvm" | |
| } | |
| "version" => { | |
| get_path_to(~"root", None).to_str() + ~"/v" + opt.unwrap() | |
| } |
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
| fn get_rsvm_directory() -> ~str { | |
| os::homedir().get_ref().to_str() + "/.rsvm" | |
| } |
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 Sequelize = require('sequelize') | |
| new Sequelize.Utils.CustomEventEmitter(function(e) { | |
| e.emit('success', 'asd') | |
| }).run().success(function(data) { | |
| console.log(data) | |
| }) |
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 options = db.define('options', | |
| { | |
| type: s.STRING, | |
| type_id: s.INTEGER, | |
| sort: s.INTEGER, | |
| deleted: s.BOOLEAN, | |
| hidden: s.BOOLEAN, | |
| field1: s.STRING, | |
| field2: s.STRING, | |
| field3: s.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 chainer = new Sequelize.Utils.QueryChainer() | |
| Artist.find({ where: {name: name} }).success(function(artist) { | |
| if (artist) { | |
| // get all tracks | |
| artist.getTracks().success(function (tracks) { | |
| if (tracks.length > 0) { | |
| tracks.forEach(function(track) { | |
| chainer.add(track.getArtists()) | |
| }) |
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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Sascha Depold http://depold.com | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
NewerOlder