exec("echo 'hello world'") # exits from ruby, then runs the command
system('echo', 'hello world') # returns the status code
sh('echo', 'hello world') # returns the status code
`echo "hello world"` # returns stdout
%x[echo 'hello world'] # returns stdout
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. Codebase | |
One codebase tracked in revision control, many deploys | |
2. Dependencies | |
Explicitly declare and isolate dependencies | |
3. Config | |
Store config in the environment | |
4. Backing services |
Getting started:
Related tutorials:
- MySQL-CLI: https://www.youtube.com/playlist?list=PLfdtiltiRHWEw4-kRrh1ZZy_3OcQxTn7P
- Analyzing Business Metrics: https://www.codecademy.com/learn/sql-analyzing-business-metrics
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
== - returns true only if the two compared entities are the same object | |
=== - is the Case Equality Operator (Case Subsumption Operator) (fits in drawer?) | |
eql? - method returns true if obj and other have the same value. | |
equal? - determines object identitfy. Compares pointers |
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
# Returns a User instance that's not saved (does not write to DB) | |
user = build(:user) | |
# Returns a saved User instance (writes to DB) | |
user = create(:user) | |
# Returns a hash of attributes that can be used to build a User instance | |
attrs = attributes_for(:user) | |
# Returns an object with all defined attributes stubbed out |
Install ElasticSearch and Java
1 wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2 sudo dpkg -i elasticsearch-1.0.1.deb
3 sudo update-rc.d elasticsearch defaults 95 10
4 sudo add-apt-repository ppa:webupd8team/java
5 sudo apt-get update
6 sudo apt-get install oracle-java7-installer
7 java -version
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
import {Component} from '@angular/core'; | |
import {Observable} from 'rxjs/Observable'; | |
@Component({ | |
selector: 'app', | |
template: ` | |
<b>Angular 2 Component Using Observables!</b> | |
<h6 style="margin-bottom: 0">VALUES:</h6> | |
<div *ngFor="let value of values">- {{ value }}</div> |
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
import {Directive, Attribute} from 'angular2/core'; | |
import {NgModel} from 'angular2/common'; | |
@Directive({ | |
selector: '[mask]', | |
host: { | |
'(keyup)' : 'onInputChange()' | |
} | |
}) | |
export class MaskDirective{ |
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": 0, | |
"size": 0, | |
"aggregations": { | |
"deviceFilter": { | |
"filter": { | |
"or": { | |
"filters": [ | |
{ | |
"and": { |