background preloader

Bundler: The best way to manage a Ruby application's gems

Bundler: The best way to manage a Ruby application's gems

Ruby QuickRef | by ryan davis Table of Contents Language General Tips These are tips I’ve given over and over and over and over… Use 2 space indent, no tabs. See for more. General Syntax Rules Comments start with a pound/sharp (#) character and go to EOL. Reserved Words alias and BEGIN begin break case class def defined? Types Basic types are numbers, strings, ranges, regexen, symbols, arrays, and hashes. Numbers 1231_234123.451.2e-30xffff 0b01011 0377 ? Strings In all of the %() cases below, you may use any matching characters or any single character for delimiters. %[], %!! 'no interpolation'"#{interpolation}, and backslashes\n"%q(no interpolation)%Q(interpolation and backslashes)%(interpolation and backslashes)`echo command interpretation with interpolation and backslashes`%x(echo command interpretation with interpolation and backslashes) Backslashes: Here Docs: Encodings: Waaaay too much to cover here. Symbols Internalized String. Ranges 1..101...10'a'..' Regexen "r"

Berkshelf Ruby Readline What is Readline? The GNU Readline Library’s website sums it up best: The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. (…) The Readline library includes additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those lines, and perform csh-like history expansion on previous commands. Users that have worked with the shell are very familiar with readline. This is the library that provides ⌃A, ⌃E, ↑, ↓, and a number of other keyboard shortcuts that you probably expect to have when working in a shell. Ruby ships with support for working with readline (or libedit). It takes just a few lines of Ruby to get the basic functionality and the core advantages that Readline provides such as keyboard shortcuts and history. Basic Functionality Here is the standard Ruby readline sample program: while line = Readline.readline('> ', true) p line end The Readline Module

Foundation Docs: Sass System Requirements Before proceeding, you'll want to install the following on your system: Starting in Foundation 5, we've started using bower to manage the updating process of Foundation. It only needs to be installed one time using the following command: Bash [sudo] npm install -g bower grunt-cli Then you can install our CLI using the following command: gem install foundation Using Foundation With Grunt + Libsass At ZURB, we prefer to run Foundation with using Grunt in conjunction with Libsass, because it's the fastest way to compile your Sass stylesheets. Create a New Project First, navigate into the directory where you want to create your project. cd path/to/sites Next we'll use the Foundation CLI to create a new project: foundation new project_name --libsass Boom, your project is created! cd project_name grunt build New Project Updating Your Project cd MY_PROJECT foundation update Using Foundation With Compass Compass is the easiest way to get going with Sass. foundation new MY_PROJECT

untitled A guide to setting up a Ruby on Rails development environment This will take about 30 minutes. We will be setting up a Ruby on Rails development environment on Mac OS X 10.11 El Capitan. Older versions of OS X are mostly compatible so follow along as far as you can and then Google search for any problems you run into. There are plenty of people who have documented solutions for them. First, we need to install Homebrew. Homebrew comes with a very simple install script. Open Terminal and run the following command: ruby -e "$(curl -fsSL Choose the version of Ruby you want to install: Now that we have Homebrew installed, we can use it to install Ruby. We're going to use rbenv to install and manage our Ruby versions. To do this, run the following commands in your Terminal: We'll be using Git for our version control system so we're going to set it up to match our Github account. cat ~/.ssh/ ssh -T Hi excid3!

Learning Ruby with the EdgeCase Ruby Koans Downloads and Customization Complete Grab this version of Foundation if you want everything in the framework in simple, vanilla CSS and JS. Download Everything Essential A simple, lighter version that includes typography, the grid, buttons, Reveal and Interchange.**59kb (okay, plus dependencies). Download Essentials Custom Include or remove certain elements and define the size of columns, colors, font size and more. Custom Download Sass Foundation is built using SCSS, and you can work with it in the same way. Install via SCSS

awslabs/aws-flow-ruby-samples Stupid Ruby Tricks twbs/bootstrap aws/aws-flow-ruby Ruby Best Practices - Reading Ruby's Standard Library for Fun and Profit Note: This post is inspired by JEG2’s excellent code reading talk at MWRC 2009, called LittleBIGRuby. Go watch it if you have time, then come back and read this. You might also want to check out the Question 5 Ways interview at Pat Eyler’s “On Ruby” blog for more code reading goodness. We all need to hunt bugs and we all need to integrate our code with other systems. Some of us need to make use of undocumented libraries, and others need to examine code to perform security audits. Why is it then, that so many developers suck at reading code? Almost a decade ago, Joel Spolsky would have told you it’s harder to read code than it is to write it , and that was probably true at one point. Beginners and even intermediate developers may need a lot of hand holding at first, that’s only to be expected. But where should you start? How I Read Code I’m going to walk through the process I generally follow when I’m reading code for the purpose of understanding its implementation. if defined?

Base Headings All HTML headings, <h1>through <h6>are available. h2. Heading 2 h3. Heading 3 h4. h5. h6. Body copy Bootstrap's global default font-size is 14px, with a line-height of 20px. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Maecenas sed diam eget risus varius blandit sit amet non magna. <p>... Lead body copy Make a paragraph stand out by adding .lead. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. <p class="lead">... Built with Less The typographic scale is based on two LESS variables in variables.less: @baseFontSize and @baseLineHeight. Emphasis Make use of HTML's default emphasis tags with lightweight styles. For de-emphasizing inline or blocks of text, use the small tag. This line of text is meant to be treated as fine print. <p><small>This line of text is meant to be treated as fine print. Bold For emphasizing a snippet of text with a heavier font-weight. Italics Heads up! Lists