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
---------- Start with EC2 server ----------- | |
- create account on Amazon | |
- create EC2 enstance | |
- create group securety in EC2 with SSH:22 (console conection) and HTTP:8080 (web conection) | |
- connect to server with SSH (test working) | |
- run code for redirect all http port to 8080 (find on full-stack bookmark) | |
- create directory "site" on root | |
- set SFTP filezila for uploading files | |
- connect to server with filezila (test working) |
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
GET, POST, DELETE, PUSH, PATCH | |
node install | |
$ npm init | |
$ npm install express --save | |
$ node app.js | |
$ npm install gulp --save | |
$ npm install gulp -g | |
$ npm install gulp-nodemon --save |
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
https://github.com/angular/angular-seed | |
$ npm install | |
$ npm start --no-spin | |
$ npm test --no-spin | |
catch(errorCallback) – shorthand for promise.then(null, errorCallback) | |
$scope.$watch(){} |
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
$ sudo npm install -g react-tools | |
$ jsx src/ build/ |
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
#---------- General Search -----------# | |
def self.search keywords | |
return Media.all if keywords.empty? #if field was empty back all content | |
search_fields = BASIC_SEARCH_FIELDS #list of table fields | |
search_array = search_fields.map { |f| "#{f} LIKE ?" } #create new array with "LIKE ?" | |
search_str = search_array.join(' OR ') #Join all cells of array | |
search_values = keywords.map { |k| "%#{k}%"} * search_fields.count #create new array and add keyword * field.length | |
Media.where(search_str, *search_values) # serach in select field on db | |
end |
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
Routing: | |
get 'demo/index' | |
match ':controller(/:action(/:id))', :via => :get | |
match ':controller(/:action(/:id))', :via => [:get, :post] | |
match ':controller(/:action(/:id(.:format)))', :via => :get | |
root "demo/index" | |
class DemoController < ApplicationController |
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
$ rake routs | |
----- config/routes.rb | |
resources :subjects | |
resources :subjects, except: :destroy | |
resources :sobjects, only: :index | |
resources :subjects, only: [:index, :show] |
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
# ----------------------------- SQL ------------------------ | |
# SELECT * | |
# FROM movies | |
# WHERE ganre = "Horrer" | |
# ORDER BY duration; | |
# ORDER BY duration DESC; | |
# WHERE duration > 100; >= <= = > < <> | |
# AND | |
# OR |
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
$ npm install -g 'typescript@^1.5.0-beta' | |
$ git clone https://github.com/fcoury/angular2-reddit | |
$ npm install | |
1 <!doctype html> | |
2 <html> | |
3 <head> | |
4 <title>Angular 2 - Poor Man's Reddit</title> |
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
/* | |
** for using Dynamic API, you should load jquery! | |
*/ | |
// vars----------------------------------------------------------- | |
var winWidth = $(window).width(), | |
mobileWidth = 750; | |
//---------------------------------------------------------------- | |
// list of function----------------------------------------------- | |
setHeight('featured-coffee-tea', winWidth, mobileWidth); |