목록Ruby on Rails - 멋쟁이 사자처럼 (7)
INSPECT
What's a Symbol?You can think of a Ruby symbol as a sort of name. It's important to remember that symbols aren't strings:"string" == :string # false Above and beyond the different syntax, there's a key behavior of symbols that makes them different from strings: while there can be multiple different strings that all have the same value, there's only one copy of any particular symbol at a given ti..
Introduction to HashesWe know that arrays are indexed with numbers that start with 0 and go up to the array's length minus one. (Think about it: an array with four elements has the indices 0, 1, 2, and 3.)But what if we want to use numeric indices that don't go in order from 0 to the end of the array? What if we don't want to use numbers as indices at all? We'll need a new array structure called..
Next!The next keyword can be used to skip over certain steps in the loop. For instance, if we don't want to print out the even numbers, we can write:for i in 1..5 next if i % 2 == 0 print i end In the above example, we loop through the range of 1 through 5, assigning each number to i in turn.If the remainder of i / 2is zero, we go to the next iteration of the loop.Then we print the value of i. T..
variable_name = gets.chomp gets is the Ruby method that gets input from the user. When getting input, Ruby automatically adds a blank line (or newline) after each bit of input; chomp removes that extra line. (Your program will work fine without chomp, but you'll get extra blank lines everywhere.) As you might have noticed, Ruby's not really returning any feedback to us. We want to be able to see..
[CSS] 웹 폰트 사용하기 대표적인 웹 폰트 제공 사이트- Google Fonts http://www.google.com/fonts- Google Fonts Early Access http://www.google.com/fonts/earlyaccess 영어 이외의 글자는 Google Fonts Early Access에서 가져다 쓰면 된다.Ctrl+F 로 Korean을 찾아 쓰면 된다. 원하는 폰트를 찾으면 링크와 사용법이 나온다. @import url(http://fonts.googleapis.com/earlyaccess/nanumpenscript.css);위 링크를 css에 삽입한 뒤 font-family: 'Nanum Pen Script', cursive;사용법 대로 적용해주면 된다. 이런식으로 웹..
bash: line 1: lionstyle.css: command not found Process exited with code: 127 그냥 서버가 돌아가고 있는데 다시 켜서 그런 것 같다. css가 안먹힐때 캐시를 지우고 다시 해보면 된다.
[First commit] 1. github.com 에서 저장소를 만든다. 저장소 이름을 유의해서 기억해둔다. 2. git init 3. git add . 4. git commit -m "first commit" 5. git remote add origin 주소 * 여기서 주소는 github 저장소 주소이다. "https://github.com/저장소 이름.git" 형식이다. 6. git push -u origin master 7. username과 password 입력 이 작업까지 끝나면 저장소 이름으로 접속가능하다. [수정] 1. git status - 수정내역 확인 2. git add . 3. git commit -am "설명" 4. git push origin master