Skip to content

Instantly share code, notes, and snippets.

View philipkiely's full-sized avatar
⌨️
Writing programming tutorials

Philip Kiely philipkiely

⌨️
Writing programming tutorials
View GitHub Profile
@philipkiely
philipkiely / weirdpythonbehavior.py
Last active June 16, 2020 19:03
A quick explanation of a python bug to watch out for
# When working with nested lists created with []*x, watch out for this bug:
a = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
a[0][1] += 1
print(a)
# gives [[0, 1, 0], [0, 0, 0], [0, 0, 0]]
# totally straightforward! but …
a = [[0]*3]*3
a[0][1] += 1
print(a)
# gives [[0, 1, 0], [0, 1, 0], [0, 1, 0]]
@philipkiely
philipkiely / ninthwritingprompt.md
Created June 13, 2020 22:52
Ninth of nine 9-minute writing prompts

Prompt: Write a business email or other form of routine communication as a poem.

An Invitation (Haiku)

Just one more meeting,
Details to be finalized.
How does Monday sound?
@philipkiely
philipkiely / eighthwritingprompt.md
Last active June 13, 2020 22:51
Eighth of nine 9-minute writing prompts

Prompt: Write three-step processes in first, second, and third person voice.

  1. I navigated to tweetdeck.twitter.com and signed into my account.
  2. I wrote a series of tweets.
  3. I used the schedule function to create an automated rollout of the series.

.

  1. You first click on the "Schedule Tweet" button. It is the middle button of three options below the composition window.
  2. You select a date and time (your local time) for the tweet to go live
@philipkiely
philipkiely / seventhwritingprompt.md
Created June 13, 2020 22:48
Seventh of nine 9-minute writing prompts

Prompt: Write a paragraph from an archeologist's report of an older aspect of programming.

Notably absent from the snippets recovered at the dig site were parenthesis around the contents of print statements. The excavation and recording work undertaken during June 2028 recovered full files including changelogs, meaning that it is highly unlikely that the parenthesis could have been moved, damaged, or lost during the archeological activity or while the projects lay dormant. This indicates that the parenthesis used with print() in Python 3 were a later invention.

@philipkiely
philipkiely / sixthwritingprompt.md
Created June 13, 2020 22:47
Sixth of nine 9-minute writing prompts

Prompt: Write the headline and first paragraph of an imagined newspaper article about a new piece of technology.

Python 3.9 Delivers New Features Alongside DepreciationWarnings

Beaverton, Oregon A report released this morning reveals that the Python Software Foundation recommends all developers look for DepreciationWarnings in their code as this minor version upgrade aims to be the last to support a number of features maintained for the sake of compatibility with Python 2.7, an older, unsupported version of the language. The release's authors note that they retained some backward compatibility options "to give more time for Python project maintainers to organize the removal of the Python 2 support." This is the latest allowance in a long history of extensions to give the people tasked with maintaining the innumerable Python 2 codebases around the world sufficient time to update to the modern, unified language. Python's upcoming 3.9 release will offer merge and update operators for the class dict

@philipkiely
philipkiely / fifthwritingprompt.md
Created June 13, 2020 22:43
Fifth of nine 9-minute writing prompts

Prompt: Write about your favorite (or least favorite) programming language or tool in the format and style of a movie review.

Bootstrap 4 (****1/2)

Bootstrap (starring Mark Otto and Jacob Thornton, first released by Twitter), a frontend library focused on mobile-compatible web development, has graced screens around the world with smart layout and professional color combinations. The fourth edition of the library simplifies the namespace and offers clearer direction to developers looking for one right way to create components like cards. The release retains the library's foundational 12-column approach to layout and provides tools for placing elements sensibly on screens of any size. A potential victim of its own success, Bootstrap 4 may result in websites looking even more similar, though challengers like Tailwind provide compelling variety to the genre. Four and a half stars.

@philipkiely
philipkiely / fourthwritingprompt.md
Created June 13, 2020 22:41
Fourth of nine 9-minute writing prompts

Prompt: If you can write in multiple languages, write something related to your profession in a language you use less often professionally. If you only know one language, use emoji.

Apologies for the poor Spanish. (It's been 3 years since I've studied Spanish and I didn't use a dictionary)

Python es una idioma de computatora. Me gusta Python por que es facíl escribir lo que quiero usando Python. Tambien yo sé JavaScript, HTML, y CSS para construir sitio web. Puedo usar Java, pero no me gusta.

@philipkiely
philipkiely / thirdwritingprompt.md
Created June 13, 2020 22:24
Third of nine 9-minute writing prompts

Prompt: Write or rewrite a paragraph in the Hemingway Editor http://www.hemingwayapp.com with 0 adverbs, passive voice, complex phrases, and hard-to-read sentences.

Original (WfSD CH1)

When you have an idea, make sure there is a demand for it. Search for key terms for your title as if you were a reader trying to find your article. Skim the top few hits. If your idea turns out to be wholly original, then that is great, but you will need to do extra research to make sure there is an interested readership for it. Finding other articles on your topic is not a bad thing; on the contrary, it means that you have identified something interesting enough for other people to write about. However, if there are hundreds of articles, books, videos, and other resources on the topic (for example, say you want to write a general introduction to programming in Python), you will have to carefully consider your angle to stand out from the crowd. This angle could come from an answer to question four or question nine. Al

@philipkiely
philipkiely / secondwritingprompt.md
Created June 13, 2020 22:21
Second of nine 9-minute writing prompts

Prompt: Rewrite a paragraph from your existing work using the 1000 most common english words using https://xkcd.com/simplewriter/ (hard mode: don't use a thesaurus)

Original (WfSD CH1)

The first step is knowing what you want to write about. If you picked up this book with a burning idea in mind, that is great. Write it down with as much detail as you can, and then follow the steps in this chapter to come up with ideas two through twenty. If you are starting from scratch, do not worry. Coming up with validated, well-scoped article ideas is not a daunting task when approached methodically. This chapter describes the exact process I have formulated through trial and error and repeated experience to generate well-scoped articles with market demand. My ideas rely on my existing skills and often prompt me to explore concepts that further my own learning.

Rewritten

The first step is knowing what you want to write about. If you picked up this book with a burning idea in mind, that is great. Write it d

@philipkiely
philipkiely / firstwritingpromt.md
Created June 13, 2020 16:38
First of nine 9-minute writing prompts

Prompt: Write or rewrite a paragraph of your existing work without using "to be" verbs like "is," "are," "was," and "were."

Original (WfSD CH9)

Writing any poem is difficult, and writing a sonnet is especially hard. This fourteen-line poetic form requires that each line be ten syllables of iambic pentameter and rhyme in a specific pattern: ABABCDCDEFEFGG. We are going to skip the hard work of writing sonnets by hand, instead using JavaScript to generate sonnets from a prepared data structure of rhyming lines from all 154 of Shakespeare's famous sonnets.

Rewritten

Crafting a sonnet, a difficult, rigidly structured poem, adds to poetry's existing challenges. The fourteen-line poetic form requires its ten-syllable lines of iambic pentameter to rhyme in a specific pattern: ABABCDCDEFEFGG. We will use JavaScript to skip the hard work of writing sonnets by hand, instead generating sonnets from a prepared data structure of rhyming lines from all 154 of Shakespeare's famous sonnets.