Skip to content

Instantly share code, notes, and snippets.

@enliven-
enliven- / ruby_books.md
Created April 24, 2018 12:57 — forked from baweaver/ruby_books.md
A list of books for learning and expanding on your Ruby knowledge.

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

A good introduction to programming in general. Easy on newer programmers.

@enliven-
enliven- / spacemacs-keybindings
Last active January 15, 2018 14:26 — forked from adham90/spacemacs-keybindings
spacemacs keybindings that i need to learn
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 |
@enliven-
enliven- / description.markdown
Created August 24, 2017 17:26 — forked from runemadsen/description.markdown
Reverse polymorphic associations in Rails

Polymorphic Associations reversed

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.

@enliven-
enliven- / The Technical Interview Cheat Sheet.md
Created June 20, 2016 08:26 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

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.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@enliven-
enliven- / capybara cheat sheet
Created April 20, 2016 10:31 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=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')
@enliven-
enliven- / wget_website
Created July 5, 2014 05:33
easy way to wget an entire website
wget --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla http://read.humanjavascript.com/ch00-foreword.html
@enliven-
enliven- / ajax_prefilter_and_jq_serialize
Created July 1, 2014 10:17
snippets from so + backbone tut for a ajax prefilter and a fn to serialize jq object
$.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) {
@enliven-
enliven- / sublimeshortcuts
Created June 30, 2014 06:04
sublime keyboard shortcuts
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()
@enliven-
enliven- / git log
Created June 1, 2014 03:15
pretty print git log
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