Ruby QuickRef | zenspider.com 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 A Different View... Bundler rocks, but you need to think differently about how to start and run your Rails app. The Bundler Way You should realise that Bundler is a library management tool. This has to be in your mind when you are getting a Rails application running on version 3.0. For example, I had a new Rails application that I want to run with PostgreSQL, so I go in and change database.yml to look at my PostgreSQL database instead of the Sqlite3 database, fairly standard, straight forward opperation. Then starting the application console however, I got a bit of a shock: This confused me for a second, I was sure that the pg gem was installed on my system, and the following confirmed it for me: mikel@baci.lindsaar.net ~ $ gem list pg *** LOCAL GEMS *** pg (0.8.0) OK, but the rails app was complaining that it couldn’t find it. This is an important datum, Bundler is a library management tool, and it allows you to totally bypass the rubygems on your system. So, first things first, bundler gives you some tools:
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/id_rsa.pub ssh -T git@github.com Hi excid3!
How to start writing a ruby gem If you are a Ruby developer, by now, you have probably used tons of gems in your apps. That's one of the best things of using Ruby, a lot of people writes repeatable code that you can easily integrate into your own apps. In this brief tutorial, I will try to explain the basic things you need to know in order to start writing your own gems, you know, just in case you have something to share with the world. Setting up the folders We'll start by creating the gem folder structure using Bundler. First thing you have to do is, install bundler itself. $ gem install bundler Now, bundler comes with a handy command to generate the basic files to start writing a gem. $ bundle gem awesome_gem create awesome_gem/Gemfile create awesome_gem/Rakefile create awesome_gem/.gitignore create awesome_gem/awesome_gem.gemspec create awesome_gem/lib/awesome_gem.rb create awesome_gem/lib/awesome_gem/version.rb The Gemspec All gems have a .gemspec file. Let's say your gem heavily depends on rails. The code And so on.
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
technicalpickles/jeweler - GitHub 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
aws/aws-flow-ruby jenkinsci/jenkins mikeaddison93/aws-sdk-ruby