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
# alien example - if-elif-else, and while loop | |
from random import randint # allows you to generate a random number | |
# variables for the alien | |
alive = True | |
stamina = 10 | |
# this function runs each time you attack the alien | |
def report(s): |
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
stuff = "Alex Randy Mandy" | |
other = "Jack Fletcher Isaac Bobby Susie Joey Manny Moe Jack" | |
apples = stuff.split(' ') | |
salad = other.split(' ') | |
basket = len(apples) | |
print basket |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>PointRider</title> | |
<!-- Bootstrap --> | |
<!-- changed order so table comes after Bootstrap --> | |
<link href="bootstrap3/css/bootstrap.css" rel="stylesheet"> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Simple Lightbox</title> | |
<style> | |
/* overlay dims screen for simple lightbox */ |
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
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/ |
OlderNewer