This file contains 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
<?php | |
class Keyword extends MoviesAppModel { | |
public function __construct($id = false, $table = null, $ds = null) { | |
parent::__construct($id, $table, $ds); | |
$this->virtualFields['movies_count'] = sprintf( | |
'select count(*) from `keywords_movies` where `keywords_movies`.`keyword_id` = `%s`.`id', $this->alias | |
); | |
} | |
?> |
This file contains 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
// routes.php | |
<?php | |
Router::parseExtensions('json', 'xml'); | |
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); | |
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); | |
CakePlugin::routes(); | |
require CAKE . 'Config' . DS . 'routes.php'; | |
?> | |
// AppController |
This file contains 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
<ul> | |
<li> | |
<a id="google" href="http://google.com" class="red-ligting">Google</a> | |
</li> | |
<li> | |
<a id="yahoo" href="http://yahoo.com">Yahoo</a> | |
</li> | |
<li> | |
<a id="bing" href="http://bing.com">Bing</a> | |
</li> |
This file contains 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
Install Java | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update | |
sudo aptitude -y install oracle-java8-installer | |
java -version | |
Install ElasticSearch | |
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.deb |
This file contains 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
api-shopmobi@0.0.0 /Users/amoreno/Projects/ShopMobi/api-shopmobi | |
├── bcryptjs@2.3.0 | |
├── bluebird@2.10.2 | |
├─┬ body-parser@1.14.1 | |
│ ├── bytes@2.1.0 | |
│ ├── content-type@1.0.1 | |
│ ├─┬ debug@2.2.0 | |
│ │ └── ms@0.7.1 | |
│ ├── depd@1.1.0 | |
│ ├─┬ http-errors@1.3.1 |
This file contains 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
/* global sequelize, module */ | |
//event.abstract.js | |
module.exports = function (sequelize, DataTypes) { | |
var schema = { | |
title: { | |
type: DataTypes.STRING, | |
allowNull: false | |
}, | |
body: { |
This file contains 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 newDoc = { | |
_id: 'user/123', | |
name: 'John Conner', | |
dob: 'February 28, 1985', | |
rank: 'Annnoying teenage hacker' | |
}; | |
db.upsert(newDoc._id, function(doc){ | |
//this time around doc == {} | |
return newDoc; |
This file contains 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
# 1. tell the user the game they are playing | |
puts "Hello Player. You are about to start the RPX." | |
# 2. CPU picks R or P or S | |
possible_choices = ["rocks", "paper", "scissors"] | |
cpu_move = possible_choices.sample | |
# 3. The player picks between "rocks", "paper", "scissors" | |
puts "Choose between rocks, paper, scissors" |
This file contains 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
# 1. Print out game instructions for player 1 and player 2 | |
# 2. Player one chooses a word | |
# 3. Display the amount of characters in the word as underscores | |
# 4. Player 2 enters a letter | |
# 5. Check if the letter player 2 entered is in the word player 1 chose |
This file contains 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
letters_correct = [] | |
letters_incorrect = [] | |
# 1. Print out game instructions for player 1 and player 2 | |
puts "Welcome to hang man..." | |
# 2. Player one chooses a word | |
puts "Player 1 enter a word" | |
# word2guess = gets.chomp | |
word2guess = "box" |