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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
HTML5-cheatsheet1
HTML5-cheatsheet2
code
README.md

README.md

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).


C

c_cheatsheet1.c

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

C++

cpp_cheatsheet1.cpp

  • 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

cpp_cheatsheet2.cpp

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

cpp_cheatsheet3.cpp

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

external links:


LLVM

LLVM_Clang_cheatsheet1 (coming soon)

  • notes and boilerplate LLVM & Clang project

external links:


Perl

perl_cheatsheet1.pl.inc

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

perl_cheatsheet2.pl

  • 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

perl_cheatsheet3.pm

  • example perl module

perl_cheatsheet4.pl

perl_cheatsheet5.pl

  • 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

Python

python_cheatsheet1.py

  • 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

Ruby

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:


Network

network_notes1.rb

  • 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

network_notes2.md

  • 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

network_notes2_htaccess.pl

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

network_notes3.md

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

my notes on:

external links (Writing Network Servers)


HTML5

HTML5-cheatsheet1

  • 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 ⁵

HTML5-cheatsheet2

  • 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:


PHP

php_cheatsheet1.php

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

php_cheatsheet2.php

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

external links


Linux

docker_cheatsheet1.md

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

docker_cheatsheet2.md (coming soon)

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

docker_cheatsheet3.md (coming soon)

  • my favorite Dockerfiles
  • unikernels

LLVM_Linux_cheatsheet1.sh

  • notes on building LLVMLinux with LLVM, Clang and LLDB

linux_writingdevicedrivers1.md

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

linux_SSD.md

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

external links:


Vim

https://github.com/nickshin/vimfiles

  • 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...
  • vim_fetch.sh 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

3D_notes1

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

Misc

external links:


License

Unlicense