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
### Install | |
brew install rbenv | |
### Installing Ruby versions | |
# list all available versions: | |
$ rbenv install -l | |
# install a Ruby version: | |
$ rbenv install 2.0.0-p247 |
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
Postgresql | |
### Install | |
brew install postgresql | |
postgres --version | |
brew services start postgresql | |
### Upgrade | |
brew upgrade postgresql |
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
fn main(){ | |
let s = String::from("hello world"); | |
let x = first_word(&s); | |
println!("first word is {}", x); | |
} | |
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
fn main() { | |
let s1 = gives_ownership(); // gives_ownership moves its return | |
// value into s1 | |
let s2 = String::from("hello"); // s2 comes into scope | |
let s3 = takes_and_gives_back(s2); // s2 is moved into | |
// takes_and_gives_back, which also | |
// moves its return value into s3 | |
} // Here, s3 goes out of scope and is dropped. s2 goes out of scope but was |
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
fn main() { | |
let s = String::from("hello"); // s comes into scope | |
takes_ownership(s); // s's value moves into the function... | |
// ... and so is no longer valid here | |
let x = 5; // x comes into scope | |
makes_copy(x); // x would move into the function, | |
// but i32 is Copy, so it’s okay to still |
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
this is my first gist ever. |