Skip to content

Instantly share code, notes, and snippets.

@stormsweeper
stormsweeper / index.html
Last active February 7, 2018 20:33 — forked from Bijesse/index.html
Exported from Popcode. Click to import: https://popcode.org/?gist=9bf50a1e01b75b2041fe91bbb45f7f7c
<!DOCTYPE html>
<html>
<head>
<title>Kim and Kanye Madlibs</title>
</head>
<body>
<div class="box">
<input class="condition" placeholder="A Medical Condition">
<button class="btn1">Click</button>

Guess the value

In the JavaScript code, there are ten calls to the function guess(). In each case, the function’s first argument is a string value, and the second argument is an expression of some kind.

Your mission is to guess the value of all ten expressions. Currently, all ten guesses are just a question mark, which is not the correct answer to any question.

Change the question mark to the correct value for the expression given as the second argument to guess() in each case.

@stormsweeper
stormsweeper / README.md
Last active February 4, 2018 17:02 — forked from alexpelan/README.md
Exported from Popcode. Click to import: https://popcode.org/?gist=83635faf9f9643358a800a7cc0492fa1

Make Your Own Madlib!

Get the value of the inputs and append them to the page to create your own madlib!

Create Your Variables, & Get the Input Values

  1. Create adjective and verb variables (we've already created noun for you).
  2. Get the value of the adjective input, and store it in the adjective variable.
  3. Get the value of the verb input, and store it in the verb variable.
@stormsweeper
stormsweeper / glossolalia.php
Created January 31, 2018 16:22
Plays random words in random voices at random speeds. Specify the time in seconds you want to play, e.g. `php glossolalia.php 30`. Default is 10 seconds.
<?php
if (strpos(`uname`, 'Darwin') === false) {
fwrite(STDERR, "This only works on macOS, sorry.\n");
exit(1);
}
$voices = array_map(
function($voice) {
return (explode(' ', $voice))[0];

Simple Calculator

You have just started as a front-end developer at your new job. Your first project is to make a simple calculator website. Your responsibility is to create the user interface for the calculator code other developers have already written.

HTML

You will need to add buttons for the numbers 0-9, each operation (addition, subtraction, multiplication, division, total), and a clear button. You may change the HTML as you need, but there must be a tag with the id screen to display the output.

CSS

You may style the calculator as you see fit, although a grid layout for the buttons is preferred.

JavaScript

Simple Calculator

You have just started as a front-end developer at your new job. Your first project is to make a simple calculator website. Your responsibility is to create the user interface for the calculator code other developers have already written.

HTML

You will need to add buttons for the numbers 0-9, each operation (addition, subtraction, multiplication, division, total), and a clear button. You may change the HTML as you need, but there must be a tag with the id screen to display the output.

CSS

You may style the calculator as you see fit, although a grid layout for the buttons is preferred.

JavaScript

var Calculator = (function(){
var first = 0;
var second = 0;
var current_op = null;
var result = null;
function update_screen(digits) {
$("#screen").text(digits);
}
function type_number(num) {
if (current_op !== null) {
<!DOCTYPE html>
<html>
<head>
<title>Mid Year #14</title>
</head>
<body>
<div id="yellow-box">
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Popcode Gist Opener</title>
</head>
<body>
<p>Copy the URL for your gist into the field below, then click the button to create a link to open it in popcode.</p>
<div>
<label for="gist-url">Gist URL:</label>
<input name="gist-ur" id="gist-url" size="50">
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1> Awesome web page</h1>
<ul>
<li>Home</li>
<li>Blog</li>