This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONTENT | |
Expressions, Statements and Controlstructures | |
Equlaity | |
Assigments | |
The ||= idiom | |
Other assignments | |
Flip-flops | |
Iterators | |
Blocks | |
Control-flow keywords |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Equality | |
The equal? method is defined by Object to test whether two values refer to exactly the same | |
object. For any two distinct objects, this method always returns false: | |
a = "Ruby" # One reference to one String object | |
b = c = "Ruby" # Two references to another String object | |
a.equal?(b) # false: a and b are different objects | |
b.equal?(c) # true: b and c refer to the same object | |
By convention, subclasses never override the equal? method. The == operator is the most common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Linux (Debian) System Tasks: | |
SSH | |
$ ssh optimusprime.se | |
or | |
$ ssh 31.192.227.207 | |
Add user (with root privileges): | |
$ sudo useradd -s /bin/bash -m -d /home/<username> -c <username> (add user with bash and homedir) | |
$ sudo passwd <username> (give password) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIT internals and workflows | |
Contents | |
THEORY AND SETUP | |
Installing and Configuration | |
Intializing | |
Object types and References | |
Remotes | |
How it works | |
.gitignore file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Content | |
Installation | |
RubyGems | |
Gemsets | |
Updates | |
Configuration | |
Environment | |
Using .rvmrc file (Best if many projects) | |
Using different gemsets | |
Databases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vim commands helpsheet | |
Contents | |
My .vimrc commands | |
Basics | |
Movement | |
Search and replacement | |
Buffers and Windows | |
Buffers | |
Windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Project 4 (this one is credited to https://gist.github.com/tomtung/1973534) | |
class Class | |
def attr_accessor_with_history(attr_name) | |
attr_name = attr_name.to_s | |
attr_reader attr_name | |
attr_reader attr_name+"_history" | |
class_eval %Q{ | |
def #{attr_name}=(value) | |
if(!defined?(@#{attr_name}_history)) | |
@#{attr_name}_history = [@#{attr_name}] |