Inspired by Literate CoffeeScript.
$ cat hello.litrb
Here's a simple program
puts "Hello, world"
$ ruby litrb.rb < hello.litrb
Hello, world
button { | |
position:relative; | |
display:block; | |
margin:50px; | |
padding:0; | |
width:250px; | |
height:50px; | |
border:none; | |
border-radius:50px; |
Inspired by Literate CoffeeScript.
$ cat hello.litrb
Here's a simple program
puts "Hello, world"
$ ruby litrb.rb < hello.litrb
Hello, world
# .railsrc for Rails 3, encoding: utf-8 | |
# see http://rbjl.net/49-railsrc-rails-console-snippets | |
if !Rails.application then warn "Rails isn't loaded, yet... skipping .railsrc" else | |
# # # | |
def ripl?; defined?(Ripl) && Ripl.instance_variable_get(:@shell); end | |
# # # | |
# loggers |
Inspired by Literate CoffeeScript.
$ cat hello.litrb
Here's a simple program
puts "Hello, world"
$ ruby litrb.rb < hello.litrb
Hello, world
-module(head_srv). | |
-compile(export_all). | |
%-export([start/1, benchmark/1, console_start/0, loop/1]). | |
-include("jsonerl/jsonerl.hrl"). | |
-record(command, {action, error, login, desc}). | |
-record(logic_state, {ies = none}). | |
-define(INTERNAL_TIMEOUT, 10000). | |
-define(LISTEN_PORT, 6070). |
module Excel | |
module Formulas | |
def pmt(rate, nper, pv, fv=0, type=0) | |
((-pv * pvif(rate, nper) - fv ) / ((1.0 + rate * type) * fvifa(rate, nper))) | |
end | |
def ipmt(rate, per, nper, pv, fv=0, type=0) | |
p = pmt(rate, nper, pv, fv, 0); | |
ip = -(pv * pow1p(rate, per - 1) * rate + p * pow1pm1(rate, per - 1)) | |
(type == 0) ? ip : ip / (1 + rate) |
# Clone rbenv into ~/.rbenv | |
git clone git@github.com:sstephenson/rbenv.git ~/.rbenv | |
# Add rbenv to your PATH | |
# NOTE: rbenv is *NOT* compatible with rvm, so you'll need to | |
# remove rvm from your profile if it's present. (This is because | |
# rvm overrides the `gem` command.) | |
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile | |
exec $SHELL |
Список изученного: | |
Ruby | |
1. "Язык программирования Ruby" Дэвид Флэнаган, Юкихиро Мацумото | |
2. "Изучаем Ruby" Майкл Фитцджеральд | |
3. "Учись программировать" Крис Пайн | |
4. Ruby в Викиучебнике (сейчас вроде как удалили) | |
5. Скринкасты ruby.hasbrains.ru (Роман Снитко) | |
6. Курсы Codeschool (Try Ruby, Ruby Bits, Ruby Bits Part 2) | |
7. Другие он-лайн курсы (RubyMonk, RubyKoans) |
Hello Class!
This is a Gist, a pastable area on the web that I'll be using to save code snippets off, so you can copy and paste from here, and don't have to worry about missing some things I type.
Slide presentation (while in class): http://192.168.1.84:9090/
Ruby Documentation: