Skip to content

Instantly share code, notes, and snippets.

@askingalot
askingalot / extra_clothesline_challenges.md
Created March 30, 2022 19:11
Extra Clothesline Challenges

Extra Clothesline Challenges

Challenge One - Difficulty Levels

Update your program so that when it starts the user is prompted to enter a difficulty level. The difficulty level they choose should affect the gameplay as described below.

The available difficulty levels should be:

Level Description
@askingalot
askingalot / tower_stairs.svg
Created February 17, 2022 01:27
Tower Stairs Animation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@askingalot
askingalot / ensure_number_input.py
Created February 15, 2022 20:56
Python Input Validation
str_monkey_count = input("How many monkeys will fit in your living room? ")
while not str_monkey_count.isnumeric():
str_monkey_count = input("Please give me a number of monkeys! ")
monkey_count = int(str_monkey_count)
if monkey_count > 1:
print("I hope those monkeys get along")
elif monkey_count == 1:
print("Lonesome monkey :(")
@askingalot
askingalot / obfuscator.py
Created December 23, 2021 14:08
A simple python script that obfuscates simple python sccripts
#!/bin/env python3
# This script will "obfuscate" a python program by base64 encoding it's code and
# then wrapping the result in a script that will base64 decode it...
# ...THEN it gets the bytes of that new script and writes those out to a final script that
# first evals the bytes to get the encoded script, then runs that script to run the real program.
# It's not very hard to un-obfuscate the generated python script, but it should be hard enough
# the novice programmers will have a hard time doing it. Hopefully they'll find writing the code
# themselves will be easier.
# You may be saying to yourself, "this is ridiculous" and I won't argue with that. It may be.
@askingalot
askingalot / zoom.sh
Last active March 20, 2021 19:09
Gnome Screen Magnfication Script
#!/bin/bash
magFloor="1.0"
magDelta="0.2"
magFactor=`gsettings get org.gnome.desktop.a11y.magnifier mag-factor`
if [ -z "$1" ]; then
magFactor=$magFloor
elif [ "$1" == "in" ]; then
magFactor=`echo "$magFactor + $magDelta" | bc`

Pizza Shoppe

An ERD Exercise

The Circle of Crust pizza shoppe is known throughout the town for their delicious, artisanal pizzas. Until now, they have eschewed computers and managed to keep track of orders via pencil and paper, but due to high (largely hipster) demand for their surprisingly expensive pizza, they now need a software system to manager orders.

You are tasked with designing a database to support a pizza order management application. As the shoppe grows more popular the database design will grow in complexity.

You will use https://dbdiagram.io/ to create an ERD that represents your database design.

@askingalot
askingalot / word-processor.md
Created February 24, 2020 21:31
Word Processor

Word Processor

A JavaScript Exercise

The goal of this exercise is to build a simple word processor that runs in a web browser -- a simplified Google Docs.

You should use React to build the application.

Phase One

@askingalot
askingalot / markdown-to-html.md
Last active March 4, 2021 21:22
Markdown to HTML

Markdown to HTML

A JavaScript Exercise

Your task is to build a web application that will display a markdown file as HTML.

The web page should contain a text box, a button and an area to display HTML. When the user enters a URL into the text box and clicks the button, the application should fetch the file at the given URL, interpret it as a markdown file, generate HTML from the markdown file and display the HTML on the page.

To test your code, use the "raw" URL to this gist.

@askingalot
askingalot / my-array-functions.md
Last active November 30, 2020 20:57
My Array Functions

My Array Functions

A JavaScript Exercise

JavaScript arrays are a powerful tool for building complex applications. Along with the ability to store sequential data, the good people at TC39 have given us many useful array methods to make our lives easier. There are methods for modifying, looping over, transforming, sorting, querying and filtering arrays.

While array methods make it a LOT easier to use arrays, most of the things array methods do could be done with more low level JavaScript code. For example, if you wanted to write a function that did the same things as the array filter method, you might write something like this.

function myFilter(array, condition) {
@askingalot
askingalot / please-can-i.md
Last active August 30, 2021 13:38
Please Can I...

Please Can I...

A JavaScript Exercise

All children know the best way to get what they want is to pester their parents until they give in. The smartest children know that for the best results they should vary both their volume and the number of repetitions of their plea.

Your task is to build a web application that will help a child build their plea.

Requirements