Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

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)://
    • Let's Encrypt
    • HTTPd
      • SSL
      • CGI / FastCGI
    • AMQP
      • RabbitMQ
    • XMPP
      • ejabberd
        • writing server components
        • websockets
        • HTTP binding
        • admin

network_notes2_htaccess.pl (OLD)

  • 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 (OLD)

  • WARNING: i do not use these anymore -- left here for reference...
  • covered things like: screen orientation, audio, video, websockets and webstorage

HTML5-cheatsheet2 (OLD)

  • WARNING: i do not use these anymore -- left here for reference...
  • covered demos like: audio, drag & drop, pointerlock and swipegesture

HTML5-cheatsheet3

  • was going to cover the following topics:
    • emscripten
      • web assembly
      • webgl2
      • multi-threading
      • file manager (async and local storage)
  • much of this work was plowed into:
    • UnrealEngineHTML5
      • run your UE4 projects in the (latest) browsers!
      • i helped maintained this for a handful of years until EPIC has ended official support of the HTML5 platform the end of 2019

external links:

  • HTML5 Gamepad Tester - fantastic way to test your gamepads on your OS on your browser
  • three.js - the mother load of all things 3D in HTML5
  • d3js.js - the mother load of all things data-driven-docs in HTML5

favorite browser extensions:

favorite mobile browser:


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


About

Nick Shin's Programming Cheatsheets

Resources

Releases

No releases published

Packages

No packages published