You're taking your first steps into Ruby
A good introduction to programming in general. Easy on newer programmers.
You're taking your first steps into Ruby
A good introduction to programming in general. Easy on newer programmers.
SPC s c remove highlight | |
**** Files manipulations key bindings | |
Files manipulation commands (start with ~f~): | |
| Key Binding | Description | | |
|-------------+----------------------------------------------------------------| | |
| ~SPC f c~ | copy current file to a different location | | |
| ~SPC f C d~ | convert file from unix to dos encoding | | |
| ~SPC f C u~ | convert file from dos to unix encoding | |
It's pretty easy to do polymorphic associations in Rails: A Picture can belong to either a BlogPost or an Article. But what if you need the relationship the other way around? A Picture, a Text and a Video can belong to an Article, and that article can find all media by calling @article.media
This example shows how to create an ArticleElement join model that handles the polymorphic relationship. To add fields that are common to all polymorphic models, add fields to the join model.
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
wget --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla http://read.humanjavascript.com/ch00-foreword.html |
$.ajaxPrefilter(function (options, originalOptions, jqXHR) { | |
options.url = 'http://backbonejs-beginner.herokuapp.com' + options.url; | |
}); | |
$.fn.serializeObject = function() { | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { |
Editing | |
Windows | |
Ctrl + Alt + Up Column selection up | |
Ctrl + Alt + Down Column selection down | |
Linux | |
Alt + ⇧ + Up Column selection up | |
Alt + ⇧ + Down Column selection down | |
Navigation/Goto Anywhere | |
Keypress Command |
/* | |
If you try to print a gitbook directly, you get nothing but the contents because of their *just* use of `@media print` styling to hide away the content section of the books. | |
Fret not, here is the codez: | |
*/ | |
$(".book-header,.book-summary,.navigation,.book-progress").remove(); | |
$(".book.with-summary .book-body").css('left', '0px'); | |
$("*").css('position', 'static'); | |
window.print() |
git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short | |
--pretty="..." defines the format of the output. | |
%h is the abbreviated hash of the commit | |
%d are any decorations on that commit (e.g. branch heads or tags) | |
%ad is the author date | |
%s is the comment | |
%an is the author name | |
--graph informs git to display the commit tree in an ASCII graph layout | |
--date=short keeps the date format nice and short |