-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,6 @@ typings/ | |
# dotenv environment variables file | ||
.env | ||
|
||
#vi temp files | ||
*~ | ||
*.swp |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
### [browser support](http://kangax.github.io/compat-table/es6/) | ||
|
||
### [default function parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters) | ||
``` | ||
function test(a=1, b={}, c=false){ } | ||
``` | ||
|
||
### [rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters) | ||
``` | ||
function test(a, ...b) {} | ||
``` | ||
|
||
### [spread (...) operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator) | ||
``` | ||
test(...a); | ||
[a, ...b, c]; | ||
``` | ||
|
||
### [object literal extensions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer) | ||
``` | ||
var o={a:1, b, c:false}; | ||
``` | ||
|
||
### [for...of loops](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) | ||
``` | ||
for(let q of iterable) { } | ||
typeof a[Symbol.iterator] == 'function' // check if a is an iterable | ||
// iterable function | ||
let q = function*() { | ||
yield 1; | ||
yield 2; | ||
}; | ||
//make an object iterable: | ||
let q = { | ||
a:1, b:2, c:3, d:4, | ||
[Symbol.iterator]: function*() { | ||
for(let i of Object.keys(this)) yield this[i]; | ||
} | ||
}; | ||
``` | ||
|
||
### [numeric literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Numeric_literals) | ||
``` | ||
// leading 0 with all other numbers 0-7 = octal | ||
let i = 0754; //decimal 492 | ||
// 0o, 0x, 0b prefix, can also be uppercase | ||
i = 0o754; // also octal, dec 492 | ||
i = 0x754; // hex, dec 1876 | ||
i = 0b1010100100 // binary, dec 676 | ||
// toString - es1 standard | ||
x = (676).toString(16); // hex of number, in string form | ||
x = (676).toString(8); // octal | ||
x = (676).toString(2); // binary | ||
// works for bases 2 - 36 | ||
``` | ||
|
||
### [string template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) | ||
``` | ||
let a = `string test ${variable} ${function(a)} ${3+2}`; | ||
let b = `line 1 | ||
line 2 | ||
line 3 with tab | ||
line 4 with ${varForLine4}`; | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
* install rvm | ||
`\curl -L https://get.rvm.io | bash -s stable --ruby` | ||
|
||
* possibly need stuff to sign | ||
``` | ||
sudo apt-get install gnupg2 | ||
gpg2 --recv-keys ... | ||
\curl -L https://get.rvm.io | bash -s stable --ruby | ||
``` | ||
|
||
* update | ||
``` | ||
gem update --system | ||
rvm gemset list | ||
rvm gemset use global | ||
gem list | ||
gem outdated | ||
gem update | ||
gem install bundler | ||
gem install nokogiri | ||
``` | ||
[current version of Rails.](http://rubygems.org/gems/rails) | ||
``` | ||
rvm use [email protected] --create | ||
gem install rails | ||
rails -v | ||
``` | ||
|
||
* new rails application | ||
``` | ||
mkdir myapp | ||
cd myapp | ||
rvm use ruby-2.4.1@myapp --ruby-version --create | ||
gem install rails | ||
rails new . | ||
``` |