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
- STL programming
external links:
- Bartlomiej Filipek - an amazing resource on all things c++
- The World Map of C+++ STL Algorithms - a fun way to learn 105 STL Algorithms in less than an hour
- lvalues and rvalues in C++ - and more great C++ crash course videos
- keep a page opened to: cppreference.com
- notes and boilerplate LLVM & Clang project
external links:
- the list is so large, they are placed here: LLVM_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:
- Ruby for the Attention Deficit Disorder Programmer cheatsheet/crash course
- on command line arguments:
- and if you ever thought to yourself, "someone has to have written this in RUBY"... chances are: someone did and threw it up on RubyGems
- 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)://
- Let's Encrypt
- HTTPd
- SSL
- CGI / FastCGI
- AMQP
- RabbitMQ
- XMPP
- ejabberd
- writing server components
- websockets
- HTTP binding
- admin
- ejabberd
- Node.js
- 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)
- the list was getting large, they are placed here: network_external_links
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
- was going to cover the following topics:
- emscripten
- web assembly
- webgl2
- multi-threading
- file manager (async and local storage)
- emscripten
- 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
- UnrealEngineHTML5
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
- 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
- it might be useful to enable PHP: short_open_tag
- keep a page opened to: PHP: function reference
- covers the following:
- some of my most used docker snippets
- local/private registry notes
- provisioning (machine)
- clustering/scheduling (swarm & swarmkit)
- orchestration (composer)
- service discovery
- monitoring/security
- 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:
- the list was getting large, they are placed here: Linux_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...
-
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:
-
HowTos:
- Vim Book (get a hard copy so you can write notes in it...)
- Derek Wyatt's Vim Tutorial Videos (HIGHLY RECOMMENDED !!! excellent crash course on Vim)
- vimcasts.org (MUST WATCH for intermediate Vim users)
- :h index (HIGHLY RECOMMENDED !!! after watching the vids above, spend a night with this help page -- don't jump out of it, just skim and keep re-skim'ing this page -- and you will be well on your way to mastering Vim)
-
Tips:
- vim quick reference card
- Graphical vi-vim Cheat Sheet and Tutorial
- How to paste text into Vim command line (advanced -- and a lot of good info on registers)
- vim tips (NOTE: you may need to click on this link twice -- the first time may send you to a vim webring...)
-
Writing your own plugins:
- Writing Vim Plugins by steve losh
- :help usr_41
- :help write-plugin
- A Byte of Vim by Swaroop C H
- search for "en:Scripting"
- Learning the vi Editor/Vim/VimL Script language
- Writing Vim Plugins by steve losh
- covers the following 3D math:
- matrix math
- vector math
- lines w/ points, lines, circles equations
- planes w/ points, lines, planes equations
- my bookmarks
- Git-LFS (with GitLab)
- rsync
- sql
external links:
-
Git:
-
Cheat Sheets Collections