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 socket | |
import math | |
def nround(n): | |
if n % 0.5 == 0: | |
return math.ceil(n) | |
else: | |
return round(n) | |
def hex2bin(hex_str): |
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/python3 | |
import sys | |
import math | |
import time | |
phi = (1+math.sqrt(5))/2 | |
print("Phi = " + str(phi)) |
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/python3 | |
import sys | |
import operator | |
numbers = sys.argv[1].split(",") | |
if len(sys.argv) > 2: | |
type = sys.argv[2] | |
else: |
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
<!-- ... --> | |
<header> | |
<img src="//placehold.it/190x190"><!-- img tag represents an image. src attribute tells the browser where the image is located, currently placehold.it, because the new logo hasn't been made yet --> | |
<h1>Student Council</h1><!-- the h1, h2, h3, h4, h5 and h6 elements represent headers, h1 being the biggest and h6 the smallest --> | |
<nav><!-- functionally nearly identical to a div, but used for semantic reasons --> | |
<a href="#introduction">Introduction</a><!-- a, short for anchor, represents a link that, when clicked, takes the user to a different page. in this case, the only change made is to the url hash, which will be handled by javascript and show a different section to the user --> | |
<a href="#members">Members</a><!-- the code I used to achieve the single-page multiple-page effect will be explained in a blog post after this one --> | |
<a href="news">News</a> | |
<a href="#contact">Contact us</a> | |
</nav> |
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><!-- tell the browser that the page is written in HTML5, the latest version of the HTML standard --> | |
<html><!-- element that contains all the HTML of the page --> | |
<head><!-- information for the browser about how to read the page --> | |
<title>Student Council</title><!-- title displayed in tab bar, bookmarks, history etc --> | |
<meta charset="utf-8"><!-- tell the browser that the file is encoded in UTF-8, a character encoding able to encode all characters in Unicode --> | |
</head> | |
<body><!-- the actual content of the page --> | |
</body> | |
</html> |
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
Hello, human (or bot). | |
This the Baconhawk tab thingamajiggy. | |
Please enjoy, no pressure. | |
(don't worry about major/minor, just wing it) |
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
(function(){ | |
var header = "Lorem Ipsum"; | |
var paragraph = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue."; | |
var headerElems = document.querySelectorAll("h1, h2, h3, h4, h5, h6"); | |
var pElems = document.querySelectorAll("p"); | |
for (var i = 0; i < headerElems.length; i++) { | |
headerElems[i].textContent = header; | |
} |
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
<!-- change all fonts --> | |
<style>*{font-family: "My scrubby font";}</style>Your text here | |
<!-- change just the header font --> | |
<span style="font-family: 'My scrubby font'">Your text here</span> |
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
<marquee scrollamount="100" style="font-family:Impact; text-shadow: 7px 7px 5px black, -7px 7px 5px black, -7px -7px 5px black, 7px -7px 5px black, 0 7px 5px black, 7px 0 5px black, 0 -7px 5px black, -7px 0 5px black, 0 0 5px black">xX_N3wt4b_Xx</marquee> |
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
function base(n, from, to) { | |
if (typeof n === "number") { | |
n = n.toString(); | |
} | |
var baseTen = parseInt(n, from); | |
return baseTen.toString(to); | |
} | |
/* | |
base("f", 16, 10) |