My Programming Cheatsheet


Command Line Interface (CLI)

Command Description
./.bash_profile unix logo

this is where you go to set up alias and configure bash.

usually found in your home directory.

man unix logo
help windows logo

man formats and displays the on-line manual pages. If you specify sec- tion, man only looks in that section of the manual. name is normally the name of the manual page, which is typically the name of a command, function, or file. However, if name contains a slash (/) then man interprets it as a file specification, so that you can do man ./foo.5 or even man /cd/foo/bar.1.gz.

pwd unix logowindows logo

The pwd utility writes the absolute pathname of the current working directory to the standard output.

which unix logo

The which utility takes a list of command names and searches the path for each executable file that would be run had these commands actually been invoked.

brew unix logo

Homebrew is the easiest and most flexible way to install the UNIX tools Apple didn't include with OS X. more on brew commands

mkdir unix logowindows logo

make a directory

cp
unix logowindows logo

copy file or directory

cat unix logo
type windows logo

The most common use of cat is to read the contents of files, and cat is often the most convenient program for this purpose.

xargs

execute arguments

find unix logo
dir-r windows logo

find files

grep unix logo
select-string windows logo

find things inside files

apropos unix logo
helpctr windows logo

find what man page is appropriate

env unix logo

look at your enivorment

echo unix logowindows logo

print some arguments

export unix logo
set windows logo

export / set a new enviroment variable

chmod unix logo
attrib windows logo

change file / directory permissions

chown unix logo
icacls windows logo

change file / directory ownership

for files windows logo

run a command on a group of files

robocopy windows logo

command-line directory and/or file replication command. Robocopy functionally replaces Xcopy, with more options

sudo unix logo
runas windows logo

become super / root user

less unix logo
more windows logo

page through a file

rmdir unix logowindows logo

remove directory


Back to top

Object Oriented Programming

Single responsibility

Code should be:

A class should do the smallest possible useful thing.

why?

Applications that are easy to change consist of classes that are easy to reuse. Reusable classes are pluggable units of well-defined behavior that have few entanglements. An application that is easy to change is like a box of building blocks; you can select just the pieces you need and assemble them in unanticipated ways.
- Metz, Sandi Practical Object Oriented Design in Ruby (POODR). Crawfordsville: Addison-Wesley, 2013 . Print.

Classes

A class is a blueprint. one blueprint can be used to make many of the same objects for example a house or a bunch of houses, can be based off the same blue print. class are to objects what blueprints are to houses.

Inheritance

Inheritance is, at its core, a mechanism for automatic message delegation. It defines a forwarding path for not-understood messages. It creates relationships such that, if one object cannot respond to a received message, it delegates that message to another. You don’t have to write code to explicitly delegate the message, instead you define an inheritance relationship between two objects and the forwarding happens automatically.
- Metz, Sandi Practical Object Oriented Design in Ruby (POODR). Crawfordsville: Addison-Wesley, 2013 . Print.

Behavior & Messages

Behavior is what an object can do
Messages are how you get that object to perform that behavoir

Back to top

Ruby

Syntax

Integer convience methods

String convience methods

Array convience methods

Hash convience methods

Enumerable

Back to top

Javascript

Syntax

Integer convience methods

String convience methods

Array convience methods

Object convience methods

Back to top

Markdown cheatsheet

Command Description

Heading 1

# text in between #

Heading 2

## text in between ##

Heading 3

### text in between ###

Heading 4

#### text in between ####
Heading 5
##### text in between #####
Heading 5
###### text in between ######
italic * text in between * or _ text in between _
bold ** text in between ** or __ text in between __
bold & italic *** text in between *** or ___ text in between ___
strike through ~~ text in between ~~

ordered list

1. text
2. text
3. text

un-ordered list

* text
* text
* text

links without title

[link without title](https://github.com/lee-egist/markdown_cheatsheet/edit/master/README.md)

links with title

[link with title](https://github.com/lee-egist/markdown_cheatsheet/edit/master/README.md "Erick's Markdown Cheatsheet")

link by reference

[reference-style link][Arbitrary case-insensitive reference text]

somewhere later in document

[arbitrary case-insensitive reference text]: https://github.com/lee-egist/markdown_cheatsheet/edit/master/README.md

table

| header | for | table |
|--------------|-------------:|-------------:|
| text | 12345 | $$$$$$ |
| *markdown* | ``codeblock``| > blockquote.|
| one | more | row |
more on brew commands
Back to top

Git & Github

Git is a version control system gitHub is a webbased application to manage git repositories and colaborate with others. read my post @ lee-egist.github.io

Git cheatsheet


Back to top

HTML

HTML is really to large to cover in one page. Here is a link to a good resource: www.w3school.com


Back to top

Cascading Style Sheets

@media

position

cross-browser compatabliity


Back to top

Sinatra

Some kind of ruby gem?

don't know what i don't know


Back to top

Rails

common commands

command description
rails new [project-name] creates a new reails project on your local machine
rails generate [model, view, controller, migration ...] [class-name] creates a model, view, controller etc...with the given class-name.
also creates necessary dependent files.

conventions

routing

Back to top

Structured Query Language

Again SQL is a very large topic. Here is a link for beginners W3school/sql
Back to top

D3

Data mapping tool

don't know what I don't know


Back to top