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
componentDidMount = () => { | |
const rectangle = new google.maps.Rectangle({ | |
...this.props.options, | |
map: this.context | |
}) | |
this.setState({ rectangle }, () => { | |
this.registeredEvents = applyUpdatesAndRegisterEvents({ | |
updaterMap, | |
eventMap, |
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
defaults: &defaults | |
working_directory: ~/repo | |
docker: | |
- image: circleci/node:8.11 | |
version: 2 | |
jobs: | |
checkout_code: | |
<<: *defaults | |
steps: |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<!-- You can also use * to allow request from any origin --> | |
<AllowedOrigin>YOUR APP's URL</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<!-- Autorization header if your using some kind of user authentication that uses it --> | |
<AllowedHeader>Authorization</AllowedHeader> | |
<!-- Content-Length header required for serving gzip using CloudFront --> |
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
{ | |
"Version": "2008-10-17", | |
"Statement": [ | |
{ | |
"Sid": "Allow Public Access to All Objects", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", |
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
1. Create the PostsController using the command: rails g controller Posts | |
2. Copy the attached file posts_controller_test.rb and paste it into test/controllers/posts_controller_test.rb | |
3. run tests using the command: rake test TEST=./test/controllers/posts_controller_test.rb | |
הקונטרולר שלכם צריך להכיל 5 פונקציות (יכולים להעזר בדוגמא המצורפת users_controller.rb) | |
index: | |
מקבלת כפרמטרים: | |
params[:user_id] - האיי די של היוזר שאת הפוסטים שלו אנחנו רוצים לקבל | |
מחזירה: | |
את כל הפוסטים של היוזר הזה |
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
From your root folder (C:\Sites ?), write the following commands: | |
rails new fakebook (Creates the fakebook app) | |
cd fakebook (Enters the fakebook folder) | |
rails g model User first_name last_name email password (Creates the User model file + migration to create users table) | |
rake db:migrate (Runs the migration and creates the users table) | |
rails g model Post text user_id:integer (Creates the Post model + migration to create posts table) |
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
class FixUserFields < ActiveRecord::Migration | |
def change | |
rename_column :users, :First_name, :first_name | |
rename_column :users, :Last_name, :last_name | |
rename_column :users, :Email, :email | |
rename_column :users, :Password, :password | |
end | |
end |
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 recursivelyFlatten(array) { | |
if (!array) { | |
return [] | |
} | |
var result = []; | |
if (Array.isArray(array)) { | |
array.forEach((value) => { | |
result = result.concat(recursivelyFlatten(value)); |