Login Register






(somewhat) Inspirational Programmer Quotes filter_list
Author
Message
(somewhat) Inspirational Programmer Quotes #1
I was rudely awakened at around 4 this morning because of a false fire alarm, and knowing me, I couldn't go back to sleep. Running on nothing but coffee and Touhou soundtracks, I made this.

It's not much, just a simple little programmer quote generator. I neglected adding a regenerate button because it makes the whole thing look out of whack(just refresh for a new quote).

Only problem is, I can't seem to get the name of the person quoted on a newline. Help is appreciated.

Sample:
http://luxgodna.tumblr.com/playground/nerdquotes

Source:
Code:
<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Programmer Quotes</title> <script type="text/javascript"> function generator(){ var quotes = ["\"Lisp isn't a language, it's a building material.\" ", "\“C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg.\”", "\“One of my most productive days was throwing away 1000 lines of code.\"", "\"Walking on water and developing software from a specification are easy if both are frozen.\"", "\"A C program is like a fast dance on a newly waxed dance floor by people carrying razors.\"", "\"Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.\"", "\"I think Microsoft named .Net so it wouldn’t show up in a Unix directory listing.\"", "\"Python's a drop-in replacement for BASIC in the sense that Optimus Prime is a drop-in replacement for a truck.\"", "\"Talk is cheap. Show me the code.\"", "\"C is quirky, flawed, and an enormous success.\""]; var names = ["Alan Kay", "Bjarne Stroustrup", "Ken Thompson", "Edward V Berard", "Waldi Ravens", "Mosher’s Law of Software Engineering", "Oktal", "Cory Dodt", "Linus Torvalds", "Dennis M. Ritchie"] var rn = parseInt(Math.random() * quotes.length); var end = quotes[rn] + "\n" + "– " + names[rn]; if(document.getElementById("result")){ document.getElementById("placeholder").removeChild(document.getElementById("result")); } var element = document.createElement("div"); element.setAttribute("id", "result"); element.appendChild(document.createTextNode(end)); document.getElementById("placeholder").appendChild(element); } </script> <style type="text/css"> body{font-family:arial, serif; background-color:#333;} #generator{background:#541111;font-size:28px;font-weight:bold;padding:20px 0 20px;text-align:center;opacity:0.7;} #generator input{font-size:16px;font-weight:normal;margin-top: 30px} #footer{font-size:12px; color:#999; margin:30px 0 0 0;} #heading{padding:130px;} </style> </head> <body onload="generator()"> <div id="wrapper"> <div id="heading"></div> <div id="generator" > <div id="placeholder"></div> </div> <div id="footer"> <p align="center">Made by <a href="https://www.sinister.ly/User-Chitoge">Chitoge</a> from <a href="https://www.sinister.ly/index.php">SL</a>. If you have any ideas in terms of stuff to add, <a href="https://www.sinister.ly/private.php?action=send&uid=23209&subject=Benedict Cumberbatch Name Generator">PM</a> me.</p> </div> </div> </body> </html>
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: (somewhat) Inspirational Programmer Quotes #2
You should set a cookie or something to prevent the same quote being shown twice.

[+] 1 user Likes Eclipse's post
Reply

RE: (somewhat) Inspirational Programmer Quotes #3
(08-20-2015, 11:54 AM)eclipse Wrote: You should set a cookie or something to prevent the same quote being shown twice.

No idea how, but it sounds like a fun addition once I add some more quotes.
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: (somewhat) Inspirational Programmer Quotes #4
You should have the quotes in a .txt file on the server and then use PHP to fetch one at random. It'd mean cleaner code and you're not making the client download all the quotes in order to view one.

Reply

RE: (somewhat) Inspirational Programmer Quotes #5
(08-20-2015, 04:59 PM)Akane Wrote: You should have the quotes in a .txt file on the server and then use PHP to fetch one at random. It'd mean cleaner code and you're not making the client download all the quotes in order to view one.

the sad truth is, I host all my web design projects on Tumblr subdomains, so I need to squeeze everything into one html file. It sounds like a great suggestion, and I'd use it if I could.
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: (somewhat) Inspirational Programmer Quotes #6
(08-20-2015, 05:04 PM)Chitoge Wrote: the sad truth is, I host all my web design projects on Tumblr subdomains, so I need to squeeze everything into one html file. It sounds like a great suggestion, and I'd use it if I could.

Just register a free hosting account somewhere.

Reply

RE: (somewhat) Inspirational Programmer Quotes #7
(08-20-2015, 05:07 PM)Akane Wrote: Just register a free hosting account somewhere.

I'll get around to it (aka I'm too lazy)
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply