You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Computational thinking (includes understanding programs run in order) +
Loops +
Conditionals =
Variables =
Objects -
Arrays -
Callbacks -
Promises -
Daily - Explicitly show computational thinking (Idea --> Abstraction --> Algorithm --> Code) in examples - Demos everyday
NO ARRAYS?!
Fix blockley run in script tag properly
Provide CSS
Have cheatsheets of all fundamental concepts made and ready to teach before camp starts so that we can have impromptu mini lectures that seem more structured.
Idea:
w1: 2 projects, t-w, th-fri
day
Intro stuff, energizers, getting to know people
Hacking twitter
Lunch
Fundamentals of html (& css) through making a portfolio website
PB&J, trust robot
computers can only do thing in order
computers can remember things
computers can do things over and over again
computers can choose to do one thing or another thing
computers can do something when something else happens
Ship! MVP of portfolio website
day
Review from day 1, finish up website
Context for lessons of Hack Camp (center on JS)
teach the fundamentals of computer science
tech the students will learn at Hack Camp
Lunch
Blockley (funcs, comp thinking, loops, variables)
Ship! Blockley project
day
Blockley (focus on funcs and variables)
Jump into phaser with examples (playing with samples on phasser's website)
day
phaser game brainstorm (need a win condition to their game to go forward)
Begin to learn the programming languages HTML & CSS
Setup the coding tools GitHub, Cloud9, Slack, which you will use throughout your time in Hack Club
Part I: Setup
1) Sign Up for GitHub
GitHub is a website used by millions of programmers to collaborate on code. Think Dropbox, but for code. We'll be using it to store and manage our code in Hack Club.
Choose a username you will be proud to show future employers. (ex.zachlatta and jonleung)
Use an email that you have access to, you'll need to access it to verify your account
Make sure to remember your username and password, you'll need this at every club meeting
When prompted to choose a plan, to choose the "Free" plan
Open your email inbox in a new tab and look for an email from GitHub. Open it and click the button to verify your email
Open https://gh.hackclub.io in a new tab and star the project by clicking on the button that looks like this on the top right:
2) Create Your First GitHub Repository
GitHub allows us to host our website using a service called GitHub Pages. This means that we can put the files of your website on GitHub and GitHub will give you a URL that you can share with the world.
Under "Repository name" write your USERNAME.github.io except instead of writing USERNAME, write your actual GitHub username. So if your username is alice1337, then you would write alice1337.github.io. You have to name your repository this in order for the GitHub Pages functionality to work correctly (more on what this is later).
Make sure that you did the previous step correctly.
Is your username entered correctly
The repository name should end in .io
After you are sure you entered in the repository name correctly, click the green "Create repository" button at the bottom.
Then copy the "HTTPS link" at the top. It should look like this:https://github.com/username/username.github.io.git. You will need this link for the next step.
3) Sign Up for Cloud9
Just like you can use Google Drive to write and organize documents written in English, we'll be using Cloud9 to write, save, and organize our code.
The techy term for a place where you can write, and organize code is "IDE" or "Integrated Development Environment"**
Double click the index.html file you just created to open it
Retype the above HTML code into your index.html file, like so:
3) Adding to the Template
There's a lot going on in the below template. For now, let's just understand that there are two sections in this template, the head and the body:
<!DOCTYPE html>
<html>
<head> ← "this section is called the **`head`** of the **`html document`**"</head><body> ← "this section is called the **`body`** of the **`html document`**"</body>
</html>
The body of the HTML document is where all the content belongs. This includes all of the words and images on the page.
The head of the HTML document is where you set the settings for the page and include other code files you want on your website.
4) Opening the Website Preview
Let's see what our website looks like so far:
First, save the file by clicking "File"(on the top right) → "Save" (or use the shortcut CTRL + S / Command + S)
Preview what the website looks like by clicking "Preview" → "Live Preview File"
As you can see, page is still blank. This is because we haven't added any content in the body section yet. Let's add some!
5) Adding My Name to the Body of the HTML
Write your name in the body of the HTML page (between the <body> and </body>). My name is Drizzy Drake so that's what I will write.
Notice that that the HTML code you write is immediately updated in the preview. That's why it's called a "Live Preview"
6) Adding a Description
Underneath on a new line, write one short sentence about yourself. I love my job as a call center representative so I'm going to write MVP hotline answerer.
Notice that the blank line between my name and description isn't reflected on the web page. Adding blank lines or spaces between your words in HTML does will not change what your website looks like.
To add spacing and other formatting, we need to use HTML tags.
7) Formatting the Heading with the Heading Tag
If I want Drizzy Drake to be a heading of my webpage, I can put it inside of what's called a heading tag, like so:
<h1>Drizzy Drake</h1>
HTML tags, like this heading tag, tell the computer how to interpret the text in between the tags.
Make your name look like a heading by surrounding your name with an h1 tag.
Note: In Cloud9, as soon as you write <h1>, it knows you will eventually want a <h1>, it just adds it for you. This is known as autocomplete.
There are two parts to the h1 tag:
<h1> is the opening tag
</h1> is the closing h1 tag. The difference is the / before the tag's name
Because the browser knows to interpret anything inside of an h1 tag as a heading, it makes your name big and bold.
5) Formatting the Description with a Paragraph Tag
Similarly to how we told the browser to treat Drizzy Drake as a header, I want to tell the browser to treat MVP hotline answerer. as a paragraph.
Put your description inside of a paragraph tag like so:
<p>MVP hotline answerer</p>
Just like h1 tag, the p tag also has an opening and closing tag.
6) Adding an Image with the Image Tag
Now let's add an image to our website.
Instead of adding a picture of yourself right now, let's just use this picture of me for now and you can change it later:
img is a self closing tag, meaning that there is no closing tag (like </img>)
src is an attribute of the image tag that specifies the URL of the image
Hmm, our image is too big. Luckily we have this other language called CSS that can help!
Part IV: CSS
HTML is the content of a page (words, images, and structure).
CSS is the look and feel (color, spacing, and size).
CSS stands for Cascading Style Sheet and is sometimes referred to just as a style sheet because it's a "sheet", the specifies all of your "styles".
Therefore, if we want to change the size of the image, we use CSS!
1) Creating the CSS file
Right click the personal_website folder you had previously created
Click "New File"
Then name the file styles.css
Note:
The .css extension tells the computer to interpret this as a css file (just like .doc and .html)
2) Connecting the CSS to the HTML
Although we've created a CSS file, until we explicitly tell the HTML file to use the CSS file, it will not use it. We have to explicitly link the CSS file in the HTML.
To link the CSS file:
Type the code for the link tag (written below), into the head section of the code.
<linkrel="stylesheet" href="styles.css">
Notes:
link is the tag name
link tags always belong in the head of the HTML document
link is a self closing tag like img
href is an attribute of the link tag and specifies the location of the CSS file. It stands for hypertext reference.
rel is an attribute that tells the browser to interpret the linked file as a stylesheet
3) Using CSS to Resize the Image
Now that we linked our CSS file to our HTML file, let's write some CSS to make the image smaller:
Double click styles.css to open it
Then add the below CSS code to make the image smaller by typing the following code into the CSS file.
img {
width:200px;
}
Then to save your changes, click "File" → "Save" (or use the shortcutCTRL + S / Command + S)
Yay! Our image got smaller!
Understanding The CSS More Deeply
If we were to translate the code into English, this
img {
width:200px;
}
would say
Select every img tag on this HTML page and set the width to be**200px**
px stands for pixels. Pixels are the tiny dots that make up a computer screen. By setting the width to 200px, we are saying we want every image on the page to span the length of 200 pixels (which is about 2 inches on a screen). If you want to learn more about pixels, you can Google "What is a pixel?"
4) Centering the Body
Then to center everything on the page
Type the below CSS code underneath our previous CSS code. Remember, don't copy and paste.
body {
text-align: center;
}
Save the file by clicking "File" → "Save" (or use the shortcutCTRL + S / Command + S)
Now everything should be centered on the page.
Understanding More Deeply
If we were to translate the code into English, this
body {
text-align: center;
}
would say:
Select every body tag on this HTML page and set the alignment of the text within the body tag to be centered
This centers everything on our page because all of the content in our HTML file is written inside the body tag.
And because everything is in the body tag, everything is centered.
You can Google "CSS text align" to see what other alignment options are available besides center
5) Changing the Font
Finally let's change the font of the page to Arial.
Add another CSS attribute to the body selector so that your CSS code for your body looks like this:
body {
text-align: center;
font-family: Arial;
}
Not all computers have the same fonts on them. To figure out what fonts most computers have on them, you can Google "web safe fonts"
6) Celebrate!
W0000t! You've successfully added the CSS to this web page!
Now to share your creation with the world.
Part V: Deployment
Right now we can only see our website on our own computer. Let's get a link that we can share with anyone on the internet!
1) Hosting on Cloud9
In the live preview of the website:
Click the button that looks like this
Then in the new window that pops up, copy the URL of the address bar
You can send this URL to anyone else in the world and they will be able to view your website!
But there's a problem:
This URL won't work indefinitely, it will stop working when you don't use your Cloud9 for a couple of days. We want something that other people will be able to open even if it's a year from now.
We can use GitHub Pages to host our website instead!
2) Pushing to GitHub Pages
Instead we can send our updates to GitHub.
Open the terminal by pressing alt + t on the keyboard at the same time. Then type in the following commands:
git add --all
git commit -am "Initial commit"
git push -u origin master
GitHub will now ask you for your username and password.
Go ahead and enter your username and then press the enter.
Then enter your password and press enter. Note that the characters don't show up on the screen but rest assured, you are still typing.
Now try to view your website by going to username.github.io/personal-website
Make sure to change username to your own username
3) Celebrate!
Yes! Your website is now public on the internet and will stay! Feel free to share this with your friends!
Part VI: Sharing with the Community
Now that you have finished building your website
In a new tab, open and follow these directions to signup for our Slack
Join your club's channel by asking your club leader for the name of the channel
In this workshop, you will learn how to use the a modified version of the Twilio API to make phone calls and send text messages that allow you to make group texting apps.
An API is an agreed upon way for one program to interact with another. APIs are cool because they let even our very simple programs to interact with very powerful programs with minimal code.
For Beginners
You will learn how to do really cool things with really simple code. You won't understand how it all works and that's totally cool. Your objective is to learn how to make things happen. You can come back later and figure out how it all works.
For More Experienced Folk
This tutorial will likely show you things that you didn't know you could do. I'd recommend skipping around in the tutorial and find what interests you.
Part 1: Setup And Making Your First Phone Call with Twilio
We're going to write some code that calls your phone and speaks some text.
Ready?
Open this JS Bin* in a new tab. Leave this tab open for the rest of the tutorial.
*JS Bin is a website for easily writing code.
We are going to use a service called Twilio to send text messages and make phone calls.
Step 1: Adding the Twilio API
To add the capability to send text messages and make phone calls, copy and paste the below script tag to the bottom of the body tag.
Note for people who happen to be using their own IDE, just copy the HTML code into your own HTML file.
Step 2: Set your sid and token
Before anything will work, we need to change "YOUR_TWILIO_ACCOUNT_SID_HERE" and "YOUR_TWILIO_AUTH_TOKEN_HERE" to your actual sid and token
The facilitator should have given you an SID and a token. If not, you should ask them for one.
Note: If you are the facilitator (or if you're just doing this workshop by yourself), follow the directions here to get your own Twilio SID and token.
Once we have the sid and token, replace YOUR_TWILIO_ACCOUNT_SID_HERE and YOUR_TWILIO_AUTH_TOKEN_HERE with your actual SID and authentication token.
Step 3: Turn off "Auto-run JS"
In the top right hand corner, turn off "Auto-run JS" so that your code doesn't automatically run every time you type something:
Step 4: Writing One Line of Code to Make a Phone Call
Then type exactly the code below into the JavaScript tab of JS Bin:
Twilio.callAndSay("555-555-5555","You just subscribed to Gossip Girl");
Note for people who happen to be using their own IDE, create and link your own JavaScript file to the HTML file you created earlier.
Don't forget the parentheses commas, and quotation marks.
This code calls the phone number 555-555-5555 and says the message You just subscribed to Gossip Girl. We don't want that.
Instead, change 555-555-5555 to your own phone number. Feel free to change the message too.
Now go ahead and press the "Run" button.
Your phone should ring shortly! Answer it!
If it doesn't work, ask a neighboring group to see if they can see what's wrong. Otherwise, raise your hand to ask a facilitator for help!
Having Some Fun
If you want, you can now duplicate the code to call more people's phones! Ask your neighbors for their phone number!
Now go ahead and press the "Run" button.
Hack!
The remainder of this workshop will be focused on free-form hacking. We'll provide a bunch of examples of what you can do with Twilio and you'll have until demos to branch off and hack on your own project.
Examples of things other people have built (open each example in a new tab to view, don't forget to replace YOUR_TWILIO_ACCOUNT_SID_HERE and YOUR_TWILIO_AUTH_TOKEN_HERE with your values to test the examples out):
Group Messaging - Text a number to send a single message to multiple friends.
Colors - Text a number a color to change the background color of a website.
Group Chat (advanced) - Expanding on Group Messaging, a proper group chat application.