Skip to content

Instantly share code, notes, and snippets.

View Jacke's full-sized avatar
👀
Mastermind

Stan Sobolev Jacke

👀
Mastermind
View GitHub Profile
@Jacke
Jacke / dabblet.css
Created September 19, 2012 06:33 — forked from anonymous/dabblet.css
Untitled
button {
position:relative;
display:block;
margin:50px;
padding:0;
width:250px;
height:50px;
border:none;
border-radius:50px;
@Jacke
Jacke / README.md
Created February 26, 2013 22:46 — forked from chrismytton/README.md

Literate Ruby

Inspired by Literate CoffeeScript.

$ cat hello.litrb
Here's a simple program

    puts "Hello, world"
$ ruby litrb.rb < hello.litrb

Hello, world

@Jacke
Jacke / .railsrc
Created March 3, 2013 11:40 — forked from janlelis/.railsrc
# .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

Literate Ruby

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)

Structure

  • Have a breakable toy side Rails project. It anchors your learning. Apply new skills/techniques here.
  • Put the code in Github. Give mentors access to the project. They'll review your code.
  • Understand the code review process and other style guidelines.
  • Deploy your breakable toy to Heroku.
  • Set learning goals weekly (e.g. X chapters of the Pickaxe, X Railscasts/week).
  • Keep a text document (using vim) to record interesting commands/concepts/things you've learned.
  • Review the text document daily for comprehension.

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.

Resources

Slide presentation (while in class): http://192.168.1.84:9090/

Ruby Documentation: