This file contains 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
<h1>Number</h1> | |
<p>Here is something to get you started:</p> | |
<button onclick="alertThem();">Alert</button> | |
<button onclick="confirmIt();">Confirm</button> | |
<button onclick="promptThem();">Prompt</button> | |
<p>Your challenge is this: Create a little game with an HTML page, a confirm dialog box and JavaScript. |
This file contains 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
<!-- Simple navigation button set | |
Not responsive | |
Aligns to right --> | |
<div id="nav"> | |
<ul> | |
<li><a href="#">Home</a></li> | |
<li id="inactive-link">About</li> | |
<li><a href="#">Portfolio</a></li> | |
<li><a href="#">Websites</a></li> |
This file contains 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
<canvas id="myCanvas" width="600" height="320"> | |
<p>Some default content can appear here.</p> | |
</canvas> | |
This file contains 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
<p>Using the canvas to understand the canvas:</p> | |
<canvas id="myCanvas" width="601" height="401"> | |
<p>Some default content can appear here.</p> | |
</canvas> |
This file contains 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
# Put this in the root directory of your repository in a file called | |
# "Makefile". When you're ready to re/publish, just open terminal, cd | |
# to the directory containing your repo and type "make publish". As | |
# you can see, it's just a bunch of commands so you can easily add | |
# more steps to this workflow. Idea by Jeff Larson | |
publish: | |
git checkout gh-pages | |
git merge master | |
git push origin gh-pages |
This file contains 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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import tweepy #https://github.com/tweepy/tweepy | |
import csv | |
#Twitter API credentials | |
consumer_key = "" | |
consumer_secret = "" | |
access_key = "" |
This file contains 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
import ftplib | |
session = ftplib.FTP('HOSTNAME','USERNAME','PASSWORD') | |
session.cwd('//DIR//DIR//DIR//') | |
f = open('Downloads/picture.jpg', 'r') | |
session.storbinary('STOR pic2.jpg', f) | |
f.close() | |
session.quit() | |
# http://www.pythonforbeginners.com/code-snippets-source-code/how-to-use-ftp-in-python/ |
This file contains 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
# testing for a prime number - use of modulo (modulus) | |
# also, a good example (for beginners) of use of a while loop | |
# journalism students often ask how one would use modulo - this shows them one case | |
n = 0 | |
print "\nWe will test a number to find out whether it is prime." | |
print "Try it with 25. Then try it with 7 or 13." | |
n = raw_input("Enter a whole number: ") | |
def testfor100(a): |
This file contains 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
# testing for a prime number - use of modulo (modulus) | |
# also, good example of a for loop | |
n = 0 | |
print "\nWe will test a number to find out whether it is prime." | |
print "Try it with 25. Then try it with 7 or 13." | |
print "Then try it with any number you like (but not too large a number!)." | |
n = raw_input("Enter a number: ") | |
n = int(n) |
This file contains 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
# some things we do with lists | |
userlist = [] # makes an empty list | |
q = "n" | |
x = "a" | |
while q == "n": | |
e = raw_input("Add an element: ") | |
userlist.append(e) | |
q = raw_input ("Do you want to quit? (y/n) > ") |
OlderNewer