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
new-host-4:~ davidransohoff$ pwd | |
/Users/davidransohoff | |
new-host-4:~ davidransohoff$ mkdir ~/project | |
new-host-4:~ davidransohoff$ pwd | |
/Users/davidransohoff | |
new-host-4:~ davidransohoff$ cd ~/project | |
new-host-4:project davidransohoff$ pwd | |
/Users/davidransohoff/project | |
new-host-4:project davidransohoff$ mkdir git-demo | |
new-host-4:project davidransohoff$ pwd |
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
new-host-4:git-demo davidransohoff$ git init | |
Initialized empty Git repository in /Users/davidransohoff/project/git-demo/.git/ | |
new-host-4:git-demo davidransohoff$ git status | |
# On branch master | |
# | |
# Initial commit | |
# | |
nothing to commit (create/copy files and use "git add" to track) |
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
new-host-4:git-demo davidransohoff$ touch README.md | |
new-host-4:git-demo davidransohoff$ git status | |
# On branch master | |
# | |
# Initial commit | |
# | |
# Untracked files: | |
# (use "git add <file>..." to include in what will be committed) | |
# | |
# README.md |
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
new-host-4:git-demo davidransohoff$ git add README.md | |
new-host-4:git-demo davidransohoff$ git status | |
# On branch master | |
# | |
# Initial commit | |
# | |
# Changes to be committed: | |
# (use "git rm --cached <file>..." to unstage) | |
# | |
# new file: README.md |
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
new-host-4:git-demo davidransohoff$ git commit -m "add README" | |
[master (root-commit) b886b3e] add README | |
0 files changed, 0 insertions(+), 0 deletions(-) | |
create mode 100644 README.md |
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
new-host-4:git-demo davidransohoff$ git remote add origin [email protected]:sranso/git-demo.git |
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
new-host-4:git-demo davidransohoff$ git push -u origin masterCounting objects: 3, done. | |
Writing objects: 100% (3/3), 217 bytes, done. | |
Total 3 (delta 0), reused 0 (delta 0) | |
To [email protected]:sranso/git-demo.git | |
* [new branch] master -> master | |
Branch master set up to track remote branch master from origin. | |
new-host-4:git-demo davidransohoff$ git push | |
Everything up-to-date |
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
// prints numbers 1-100 | |
// when the number is divisible by 3, say fizz | |
// when the number is divisible by 5 say buzz | |
// when the number is divisible by 3 and 5 say fizzbuzz | |
for (var i = 1; i <= 100; i++) | |
{ | |
if (i % 3 == 0 && i % 5 == 0) {console.log("fizzbuzz")} | |
else if (i % 3 == 0) {console.log("fizz")} | |
else if (i % 5 == 0) {console.log("buzz")} |
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
# prints numbers 1-100 | |
# when the number is divisible by 3, say fizz | |
# when the number is divisible by 5 say buzz | |
# when the number is divisible by 3 and 5 say fizzbuzz | |
101.times do |i| | |
next if i == 0 | |
if i % 3 == 0 && i % 5 == 0 | |
puts "fizzbuzz" | |
elsif i % 3 == 0 |
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
#http://rosettacode.org/wiki/FizzBuzz#Ruby | |
1.upto(100) do |n| | |
print "Fizz" if a = (n % 3).zero? | |
print "Buzz" if b = (n % 5).zero? | |
print n unless (a || b) | |
print "\n" | |
end |
OlderNewer