Loading
Ric McLaughlin
This is a live streamed presentation. You will automatically follow the presenter and see the slide they're currently on.
Session 1
From Nothing to a Static Website
v1.5
v1.5
Participants | 10 |
---|---|
Finished with Portfolio | 100% |
Git endorsement | 80% |
tweet new post = jekyll endorsement | 20% |
tweet project = gulp.js endorsement | 20% |
I am a free code camper exactly like you...
I love helping people that are helping themselves
If you ask, we will figure it out
v1.5
the cat dev manager. I need developers. Developers that can
write code that does not suck,
collaborate with others,
can communicate ideas,
and does not drool on themselves or bath in perfume.
v1.5
And I worked really hard to become a developer!
Grampa says, "Send out resumes!!"
Now how do I find my first gig?
v1.5
v1.5
Just Telling You:
This is the most amazing thing I have ever seen.
v1.5
I offer no proof; you have to believe me at my word.
v1.5
I offer a little proof; perhaps you might me believe me.
This is the most amazing thing I have ever seen.
The most amazing thing I have ever seen.
v1.5
v1.5
Anatomy of a Github Portfolio
Project Detail Includes:
Projects by technology used - by tag
v1.5
Code in a Browser
Codepen
c9
local
Code in a Browser
c9
local
(Or why c9 is your next step)
FCC progression
FCC-Ballard progression
emmet class
Portfolio
class
Windows?Vagrant
v1.5
v1.5
v1.5
Terminal or CommandLine
Project Navigator
Editor
Preview
v1.5
v1.5
an open source
coding collaboration website
based on the git version control system
that turned into a social network
v1.5
Git is a version control system written by Linus Torvalds
Git and github are so linked together they are almost one thing
Fun Fact: Linus Torvalds also wrote the linux kernel
v1.5
Fun Fact: As of 2015 there are 30 Million+ repositories on github!
Feature: You can share & partake of open source software
Benefit: Amazing code, free for the taking; sharing is good and feels good too
So let's share some sweet source with the world... using git and git hub!
v1.5
http://github.com/[github user name]
Click on Create a new workspace
Workspace Name: first_one
Clone from Git or Mercurial URL:
https://github.com/ricmclaughlin/simple-project.git
v1.5
# <- the hash make a comment in bash
# type this next line in and notice it does NOTHING
# type me in - I am a comment
# use pwd to show what directory are we in!
pwd
How do I make a comment?
What directory am I in?
v1.5
# us ls to list files and subdirectories
ls
What files and directories are there?
v1.5
Make first_one workspace
Connect first_one repo from github
Make first_one repo
first_one
c9 Clones
(two way link)
c9 makes a window into first_one vm
v1.5
Git | English | Why? |
---|---|---|
Clone | copy from github to your machine | Try it out local |
v1.5
Fun Fact: Everyone screws up
Feature: Git saves a version of your stuff that you can find later!
Benefit: You never loose your progress; you always know where your work is
rm readme.md # oh crap, I just deleted all my work.
# oh crap, it didn't work... why?
rm README.md # oh crap, I really did deleted my stuff..
git checkout README.md # Amazing, octocat has my six!
v1.5
Git | English | Why? |
---|---|---|
Checkout | get last commited version | Your working version is screwed and you want to undo the screwing |
v1.5
Not Fun Fact: Your machine will crash someday
Feature: Github backs up your stuff
Benefit: When your machine crashes your stuff remains safe
Let's add a file to our project and push our changes up to github
v1.5
Make a file
Save the file as index.html
Right click on index.html and do preview
Checkout our awesome work in the preview tab
<h1>Yeah, this is it - My new page!</h1>
v1.5
<h1>Yeah, this is it - My new page!</h1>
<p>and now I added some text</p>
Save
Refresh your preview browser tab
v1.5
http://github.com/[github user name]/first_one
Did it work???
# stage your changes
git add .
# does git see your changes?
git status
# now push your changes
git push origin master
# commit your changes with
# save message in the present tense
git commit -m "add index.html"
v1.5
staging
working
(master)
master
Change
git add .
git commit -m "message in present tense"
index.html
index.html
changes are committed
origin
git push origin master
changes are pushed
v1.5
Git | English | Why? |
---|---|---|
git push | copy latest commit to remote server | sync your changes offsite |
origin | the name of remote project (on github) | it is git convention to call it origin |
v1.5
Fun Fact: You will experiment a lot in the coming months years
Feature: Branch to leave the working stuff working before you start changing things
Benefit: Experiments only cost time;
Experiment on a feature branch!
v1.5
# make a branch called "add_octocat"
git branch add_octocat
# Use your new branch
git checkout add_octocat
# what does your terminal prompt tell you?
# make a new file on your website
echo "Hey there Octocat!" > octocat.html
# what does git tell you?
git status
v1.5
staging
working
(master)
master
Create
git branch add_octocat
git checkout
add_octocat
octocat.html
origin
working
(add_octocat)
add_octocat
v1.5
# what did we change?
git status
# add our single change
git add octocat.html
# commit our change
git commit -m "add octocat.html"
# are we good?
git status
# what branch are we one?
v1.5
staging
working
(master)
master
octocat.html
origin
working
(add_octocat)
add_octocat
octocat.html
git add
octocat.html
git commit -m "add octocat.html"
v1.5
# switch to master branch
git checkout master
# what does your terminal prompt tell you?
# master should not have octocat.html!
ls
# merge my_branch into master
git merge add_octocat
# octocat.html should be in the house!
ls
v1.5
staging
working
(master)
master
octocat.html
origin
working
(add_octocat)
add_octocat
working
(master)
No octocat.html
git checkout
master
git merge
add_octocat
octocat.html!!!
v1.5
# delete add_octocat branch to clean up
git branch -d add_octocat
# did we delete add_octocat?
git branch
# everything good?
git status
# push to github
git push origin master
v1.5
staging
working
(master)
master
octocat.html
origin
working
(add_octocat)
add_octocat
working
(master)
git branch -d add_octocat
octocat.html!!!
octocat.html!!!
git push origin master
v1.5
Git | English | Why? |
---|---|---|
branch | make separate version to modify | You don't want to risk screwing up the master branch! |
merge | integrate branches together | your work on the branch is done |
v1.5
v1.5
Checkout your portfolio:
Imagine it is more like:
Contributions, repositories and public activity = Collaboration
Browser
http://github.com/[your github username]
Browser
http://github.com/Swiip
v1.5
Fun Fact: You can personalize your website with its own domain!
Feature: Every github profile can have a free website associated with it
Benefit: A free portfolio website, baby!
v1.5
Create a new repository called
[github username].github.io
(ignore setup page - we will do this in sec)
http://github.com/[github user name]
Create a new workspace called
portfolio
v1.5
# clone your project
git clone https://github.com/[github user name]/[github user name].github.io
# how do you know it worked?
Open your [github username].github.io workspace
# make the first file in the project
echo "<h1>My Portfolio</h1>" > index.html
# because we cloned your repo git is ready to roll
git add .
# commit your awesome new project
git commit -m "initial commit"
# push your portfolio project to git hub
git push origin master
# how do we know it worked?
v1.5
Take a look at your new portfolio:
Browser
[github username].github.io
v1.5
v1.5
Fun Fact: You have gone to lots of github project pages without realizing it....
Feature: Every github project gets a static website on the gh-pages branch
Benefit: Every single one of your github projects, even when it isn't a website, can have a website
Checkout the main bootstrap site hosted on github pages:
Browser
http://getbootstrap.com
v1.5
Browser
http://github.com/twbs/bootstrap
Browser
Let's figure out how this works:
http://github.com/twbs/bootstrap/tree/gh-pages
Now look at the gh-pages branch:
Github stores your project website in the gh-pages branch!
v1.5
# make your gh-pages branch & checkout (in one step!)
git checkout -b gh-pages
# confirm we did it right
git status
# push the gh-pages branch to github
git push origin gh-pages
Checkout your project in the web!
http://username.github.com/first_one
Open your first_one workspace
v1.5
staging
working
(master)
master
git checkout -b gh-pages
origin
git push origin gh-pages
http://username.github.com/first_one
gh-pages
gh-pages
v1.5
working
(gh-pages)
v1.5
# add then commit your changes
git add .
git commit -m "add first project link"
# merge our feature branch
git merge project_link
# confirm we did it right
git status
# push the branch to github
git push origin master
# delete our feature branch
git branch -d project_link
# add this link to your index.html
Checkout my <a href="https://[github user name].github.io/first_one">Project</a>.
<p>It is raw HTML with no CSS. You can see the styling isn't that great</p>
Open your [github user name].github.io workspace
# branch
git checkout -b project_link
v1.5
You have a portfolio website!
With a first small project that is live!
With a link to the first project from your portfolio!
In your browser take a look at your portfolio!
http://[github user name].github.io/
v1.5
Create a second_one c9 workspace and clone second_one into that workspace
In a git feature branch create index.html file
Add some HTML of your choosing to index.html
In the c9 browser tab preview your changes
Merge your feature branch to master
Push your changes to github
Create a gh-pages branch and push the gh-pages branch to origin
Confirm you your new project is live at at https://[github username].github.io/second_one
New website project: second_one
Open your portfolio workspace on c9
In a git feature branch, open your index.html
Add a link to the second_one source code
Add a link to the second_one live project
Save then preview your changes
Merge your feature branch into master
Push your changes to github
Confirm it worked
Add the second_one project to your portfolio