Nick Shin's Programming Cheatsheets
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Nick Shin's Programming Cheatsheets

This page will list some sample code files that I have writen and have made available to the public domain.

These are mostly to help remind me a few bits of details that (when working with a pile of different programming and scripting languages) I like to copy and paste code that I use a lot (efficiently), often (lazy) or rarely (forgetful).



  • will describe design patterns in C (even though patterns are normally used with Object Oriented languages)
    • creational patterns
    • structural patterns
    • behavioral patterns
    • design principles



  • covers the following C++ usage:
    • constructors
    • destructors
    • base, derived, multiple inheritance and friendship classes
    • private vs protected vs public member data access
    • pure and basic virtual function declarations
    • polymorphism
    • type casting


  • covers the following C++ usage:
    • templates
    • const-ness
    • dynamic memory
    • exceptions


  • covers the following:
    • STL programming
      • containers
      • algorithms
    • some Boost library features
      • foreach
      • smart pointers
    • and using class string

external links:


LLVM_Clang_cheatsheet1 (coming soon)

  • notes and boilerplate LLVM & Clang project

external links:


  • written to be included in by perl_cheatsheet2 and contains the following perl snippets:
    • unique sort
    • time n date
    • file notes
    • wget

  • executable and contains more perl snippets:
    • file IO
    • fork
    • arrays, arrays of arrays, array references, slice n splice
    • hashes, hashes of arrays, hash references
    • references to functions
    • and some boiler plate code

  • example perl module

  • using the perl module
  • while showing the tiny differences on:
    • require
    • use
    • fully qualified names
    • automatic exported names
    • controlled (manually) exported names

external links:

  • good collection of perl tips: Perl Training Australia - Perl Tips
  • and if you ever thought to yourself, "someone has to have written this in PERL"... chances are: someone did and threw it up on CPAN


  • covers the following python usage:
    • some of my most used python snippets
    • file IO
    • dictionary
    • lists, tuples and arrays
    • classes

here are some more python code i have made free to the public:

external links:

  • keep a page opened to: Python: Library Reference
  • and if you ever thought to yourself, "someone has to have written this in PYTHON"... chances are: someone did and threw it up on PyPI


Please see my networking notes for more sample code written in Ruby used to generate the all of the network code and pretty printed HTML files.

external links:



  • covers networking sockets (open read write close) (for both peer2peer and multi-users) in:
    • C/C++
    • C#
    • Exlixir
    • GoLang
    • Java
    • Node.js
    • Perl
    • Python
    • Ruby
    • Scala

if the "all in one file" is too confusing to look at (hurray for VIM! ":set filetype=lang"), run the script to generate all of the network code for the different programming languages:

ruby network_notes1.rb code

  • covers the following networking snippets:
    • Node.js
      • http(s)://
      • ws(s)://
      • AMQP(s)://
      • XMPP(s)://
    • HTTPd
      • SSL
      • CGI / FastCGI
    • AMQP
      • RabbitMQ
    • XMPP
      • ejabberd
        • writing server components
        • websockets
        • HTTP binding
        • admin

  • generates .htaccess files (for authentication access) for
    • Apache
    • lighttpd

  • covers the following networking snippets:
    • Concurrency
    • WebSockets
    • WebRTC
    • SSL (libraries)
    • behind firewall (STUN TURN ICE)

my notes on:

external links (Writing Network Servers)



  • WARNING: these are pretty old and i don't really use them anymore -- left here for reference...
  • covers the following HTML5 topics:
    1. canvas
    2. css3
    3. devicemotion ¹
    4. deviceorientation ¹
    5. eventsource ²
    6. fullscreen ¹
    7. geolocation ¹
    8. javascript ² classes and modules
    9. svg
    10. webaudio and webvideo
    11. webGL ¹: requestAnimationFrame (warning: many mobile browsers do not have hardware acceleration)
    12. websocket ²
    13. webstorage: appcache
    14. webstorage: FileReader ³
    15. webstorage: indexDB ² ⁴
    16. webstorage: localStorage
    17. webworkers ⁵


  • WARNING: these are pretty old and i don't really use them anymore -- left here for reference...
  • covers the following demos:
    1. AudioAPI
    2. Audio Element (webaudio revisited -- tests): (NOTE: this is NOT AudioAPI but the <audio> element)
    3. drag & drop ¹
    4. gamepad ⁶ (note: it seems better to just map pad to keyboard strokes...)
    5. mouselock ⁶
    6. swipegesture ²: sketchpad + noclickdelay

note: all files are written static (i.e. plain ol' HTML) so they can be looked up or run as-is.

  1. copy of reference source (or close to it) for testing purposes
  2. terse and was written to be re/usable
  3. WARNING: Safari does NOT support FileReader API (but WebKit [on Chrome] and Mozilla does).
  4. WARNING: WebKit has a slightly different handler requirement after accessing DB with no results
  5. WARNING: WebKit does NOT support subworkers (but Mozilla does). Mozilla does NOT support SharedWorker (but WebKit does).
  6. Work In Progress... coming soon

HTML5-cheatsheet3 (coming soon)

  • covers the following topics:
    • emscripten
      • web assembly
      • webgl2
      • multi-threading
      • file manager (async and local storage)

external links:



  • covers the following PHP usage:
    • predefined variables: _GET _POST _SERVER _FILES
    • binary and file handling
    • passing by reference
    • classes


  • covers the following PHP usage:
    • user agent detection
    • crafted headers
    • memcache
    • NoSQL (coming soon, my most used snippets...)

external links


  • covers the following:
    • some of my most used docker snippets
    • local/private registry notes (coming soon)

  • provisioning (machine)
  • clustering/scheduling (swarm & swarmkit)
  • orchestration (composer)
  • service discovery
  • monitoring/security (coming soon)

  • my favorite Dockerfiles
  • unikernels

  • notes on building LLVMLinux with LLVM, Clang and LLDB

  • covers the following:
    • kernel module programming
    • character device driver
    • usb stick example

  • notes on SolidStateDrive optimizations, display DPI settings and surface pro 3 configurations

external links:


  • latest vimrc file I use:

    • editor configuration
    • plugin mapings
    • and some archived configs and maps for reference
  • my vim_notes.txt on plugins & stuff

    • a list of plugins i found useful in the past or currently
    • a bit of how to use them and where to find them
    • and old settings that i used to use...
  • plugins

    • normally, plugins only need be placed in: .vim/bundle
    • but sometimes, some packages needs some extra hand holding to get em working (especially when working on a bunch of different OS)
    • this script helps me remember them

external links:

3D Math


  • covers the following 3D math:
    • matrix math
    • vector math
    • lines w/ points, lines, circles equations
    • planes w/ points, lines, planes equations


external links: