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++
¤ C# Java
Perl
¤ Python
¤ Ruby
Network
¤ HTML5
¤ PHP
3D
¤ Misc
C
2010-09-20: c_cheatsheet1.c
- c_cheatsheet1 will describe design patterns in C, even though it
is normally used with Object Oriented languages.
- creational patterns
- structural patterns
- behavioral patterns
- design principles
C++
2010-08-31: cpp_cheatsheet1.cpp
2010-08-31: cpp_cheatsheet2.cpp
2010-09-01: cpp_cheatsheet3.cpp
- cpp_cheatsheet1 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 covers the following C++ usage:
- templates
- const-ness
- dynamic memory
- exceptions
- cpp_cheatsheet3 covers the following:
- STL programming
- some Boost library features
- and using class string
C# & Java
- C#, JAVA & PHP classes are very similar to each other. Please see my
PHP cheatsheet's class section for example code. Please
also see my networking notes for more sample code written
in C# and JAVA.
C
¤ C++
¤ C# Java
Perl
¤ Python
¤ Ruby
Network
¤ HTML5
¤ PHP
3D
¤ Misc
Perl
2010-09-04: perl_cheatsheet1.pl.inc
2010-09-04: perl_cheatsheet2.pl (updated 2011-02-09)
2010-10-04: perl_cheatsheet3.pm
2010-10-04: perl_cheatsheet4.pl
2010-10-04: perl_cheatsheet5.pl
- perl_cheatsheet1 written to be included in by perl_cheatsheet2
and contains the following perl snippets:
- unique sort
- time n date
- file notes
- wget
- perl_cheatsheet2 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 is an example perl module and
perl_cheatsheet4 & perl_cheatsheet5 uses the perl module
while showing the tiny differences on:
- require
- use
- fully qualified names
- automatic exported names
- controlled (manually) exported names
- 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
2010-10-05: python_cheatsheet1.py
- python_cheatsheet1 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:
Ruby
coming soon
- Please see my networking notes for sample code written in Ruby used to generate the all of the network code and pretty printed HTML files.
C
¤ C++
¤ C# Java
Perl
¤ Python
¤ Ruby
Network
¤ HTML5
¤ PHP
3D
¤ Misc
Network
2010-10-15: network_notes1.txt
- network_notes1 covers networking sockets (open read write close)
(both peer2peer and multi-users) in:
- C/C++
- C#
- Java
- Perl
- Python
- Ruby
here is the (ruby) script used to
generate all of the code seen in network_notes1 -- so you can test
and read the raw code individually if the "all in one HTML file" is too
confusing to look at (hurray for VIM! ":set filetype=lang").
to run the script, type:
- ruby network_notes1.txt code
HTML5
2011-12-21: HTML5-cheatsheet1
2012-01-21: HTML5-cheatsheet2 - (coming soon)
- HTML5 cheatsheet1 covers the following HTML5 topics:
- canvas
- css3
- devicemotion[1]
- deviceorientation[1]
- eventsource[2]
- fullscreen[1] [3]
- geolocation[1]
- javascript[2] classes and modules
- svg
- webaudio and webvideo
- webGL[1] [4]: requestAnimationFrame
- websocket[2] [5]
- webstorage: appcache
- webstorage: FileReader[6]
- webstorage: indexDB[2] [7]
- webstorage: localStorage
- webworkers[8]
- HTML5 cheatsheet2 covers the following demos:
- drag & drop[1]
- gamepad[1]
- gestures[2]: sketchpad + noclickdelay
- mouselock[1]
- webapp: prism chromeless web-app-capable phoneGap
all files are written static (i.e. plain ol' HTML -- no PHP) so they can be looked up as-is.
- copy of reference source (or close to it) for testing purposes
- terse and was written to be re/usable
- note: some browsers needs to have full-screen-api ENABLED MANUALLY
- note: some browsers needs to have WebGL ENABLED MANUALLY
- note: some browsers needs to have WebSocket ENABLED MANUALLY
- WARNING: Safari does NOT support FileReader API (but WebKit [on Chrome] and Mozilla does).
- WARNING: WebKit has a slightly different handler requirement after accessing DB with no results
- WARNING: WebKit does NOT support subworkers (but Mozilla does). Mozilla does NOT support SharedWorker (but WebKit does).
PHP
2010-09-06: php_cheatsheet1.php
- php_cheatsheet1 covers the following PHP usage:
- predefined variables: _GET _POST _SERVER _FILES
- binary and file handling
- passing by reference
- classes
C
¤ C++
¤ C# Java
Perl
¤ Python
¤ Ruby
Network
¤ HTML5
¤ PHP
3D
¤ Misc
3D Math
2010-10-08: 3D_notes1.txt
- 3D_notes1 covers the following 3D math:
- matrix math
- vector math
- lines w/ points, lines, circles equations
- planes w/ points, lines, planes equations
More Cheatsheets Online
- my favorite external cheatsheets online:
- development
- distro [ upgrade | new install ]
- system
- Cheat Sheets Collections
- From html-5tutorial.com (a really nice and giant handy list of all kinds of info for the web developer and *nix host admin/provider in you)
C
¤ C++
¤ C# Java
Perl
¤ Python
¤ Ruby
Network
¤ HTML5
¤ PHP
3D
¤ Misc
Copyright © 2010-2012 by Nick Shin. All Rights Reserved.
These pages are designed by ESTSS.