Code snippets for various programming languages and libraries
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_other Reorganizing, putting more tutorials Oct 16, 2018
c++ Reorganizing, putting more tutorials Oct 16, 2018
c Reorganizing, putting more tutorials Oct 16, 2018
java Reorganizing, putting more tutorials Oct 16, 2018
nasm Reorganizing, putting more tutorials Oct 16, 2018
python Reorganizing, putting more tutorials Oct 16, 2018
ruby Reorganizing, putting more tutorials Oct 16, 2018
.gitignore Adding Go web scraping examples Mar 25, 2018
C_Cpp Compiler and IDE Options.txt Reorganizing, putting more tutorials Oct 16, 2018
C_Cpp Install gcc on Windows with MSYS2.html Reorganizing, putting more tutorials Oct 16, 2018
Cpp_Compiling Qt5 from source.txt Reorganizing, putting more tutorials Oct 16, 2018
Cpp_Getting_Started.txt Reorganizing, putting more tutorials Oct 16, 2018
Debian Package dpkg Tutorial.html Reorganizing, putting more tutorials Oct 16, 2018
Docker Tutorial.html Reorganizing, putting more tutorials Oct 16, 2018
GPG Basics Tutorial.html Reorganizing, putting more tutorials Oct 16, 2018
Go Compile for Docker.md Reorganizing, putting more tutorials Oct 16, 2018
Go cross compiling.html Reorganizing, putting more tutorials Oct 16, 2018
Google Hacking.md Reorganizing, putting more tutorials Oct 16, 2018
Java Creating and Using Packages.md Reorganizing, putting more tutorials Oct 16, 2018
Java JAR Tutorial.md Reorganizing, putting more tutorials Oct 16, 2018
Java Server Pages (JSP) Tutorial.md Reorganizing, putting more tutorials Oct 16, 2018
Java Servlet Tutorial.md Reorganizing, putting more tutorials Oct 16, 2018
Java TomCat Tutorial.html Reorganizing, putting more tutorials Oct 16, 2018
Java packet capturing.html Reorganizing, putting more tutorials Oct 16, 2018
LetsEncrypt SSL Tutorial.html Reorganizing, putting more tutorials Oct 16, 2018
Maven Make Mac Apps and Dmg.md Reorganizing, putting more tutorials Oct 16, 2018
Maven Make Windows Exe.md Reorganizing, putting more tutorials Oct 16, 2018
Maven Tutorial.html Reorganizing, putting more tutorials Oct 16, 2018
Maven Upload to Central Repository.md Reorganizing, putting more tutorials Oct 16, 2018
Maven m2 settings sample.xml Reorganizing, putting more tutorials Oct 16, 2018
Nginx Tutorial.html Reorganizing, putting more tutorials Oct 16, 2018
OpenSSL Create self-signed SSL cert.html Reorganizing, putting more tutorials Oct 16, 2018
OpenVPN Server Setup Tutorial.md Reorganizing, putting more tutorials Oct 16, 2018
README.md Rewording README Dec 1, 2016
Systemd service files.html Reorganizing, putting more tutorials Oct 16, 2018
Windows Add Icon to Exe.txt Reorganizing, putting more tutorials Oct 16, 2018
Windows Batch Script Tips.txt Reorganizing, putting more tutorials Oct 16, 2018
Windows Create MSI Installer.txt Reorganizing, putting more tutorials Oct 16, 2018

README.md

The Cookbook Method

A cookbook in the programming context is collection of tiny programs that each demonstrate a particular programming concept. The Cookbook Method is the process of learning a programming language by building up a repository of small programs that implement specific programming concepts. Starting with a Hello World program and building the knowledge piece by piece on top of that.

If you are a beginner, you will probably want to start out with one language like Python and start building up your repetoire of snippets for reference and confidence. If you are a seasoned developer, you may want to start building a cookbook from scratch for a new language you have never used, or keep a cookbook for more advanced topics in a language you are already familiar with.

Here is an example of when my Cookbook comes in handy. Recently I was faced with a situation where I needed to make an HTTP request to an API, parse the JSON response, generate a CSV spreadsheet, and email the spreadsheet. Because I already had my own cookbook snippets for doing each of those three actions, it was really easy to put together a program that did what I needed it to.

Benefits of Building Your Own Cookbook

  • You can share it with others
  • Learn topics that are interesting to you
  • You build up your knowledge in small increments
  • You can see your progress over time
  • You have a library of reference material in your own style.
  • It is quicker than looking up documentation or looking for a Stack Overflow answer.
  • Explore new topics
  • Learn new programming languages.
  • Tips for Building a Cookbook
  • Store your cookbook in a version control system like Git.
  • Keep a to do list of topics or programming languages you want to explore and learn
  • It does not have to be just code. I have a lot of plain text .txt files with notes on things like how to create a Python pip package, creating Ruby Gems, or how to create a runnable JAR in Java. Sometimes tips on installing prerequisites if something was difficult or just notes on how to compile and run programs.
  • It can also be template programs. For example I have a base chrome browser extension that doesn't really do anything itself, but it is a fully functional extension with all the boilerplate done and ready for me to start developing.
  • Programs should be fully runnable and not just chunks of code without context that do not compile and execute
  • Keep the snippets small, simple and to one topic

Example Cookbook Topics

Everyone has different goals with programming so identify topics relevant to your interests. Here are some ideas if you do not know where to get started.

  • Hello, world
  • Getting user input from stdin
  • Taking command line arguments
  • Reading and writing files
  • Using TCP sockets
  • Making HTTP requests
  • Parsing JSON
  • Creating a CSV file
  • Making database connections
  • Playing an audio file
  • Multithreading
  • Drawing 2D graphics to screen
  • Drawing 3D graphics to screen
  • GUI programming

The DevDungeon Cookbook