Skip to content

Instantly share code, notes, and snippets.

View a1ip's full-sized avatar

Philippe Rigovanov a1ip

View GitHub Profile
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
brews = []
out = IO.popen("brew list", "r") do |io|
brews = io.read.split "\n"
end
def parse(brew, brew_info)
in_options = false
print "brew reinstall -v #{brew} "
brew_info.split("\n").each do |m|
#puts m.inspect
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- TUMBLR APPEARANCE OPTIONS -->
<meta name="if:Include Like Button" content="0">
<meta name="if:Include Tweet Button" content="0">
HANDY ONE-LINERS FOR RUBY November 16, 2005
compiled by David P Thomas <davidpthomas@gmail.com> version 1.0
Latest version of this file can be found at:
http://www.fepus.net/ruby1line.txt
Last Updated: Wed Nov 16 08:35:02 CST 2005
FILE SPACING:

Структура программы

  • require выражения

  • include выражения

  • определение классов и модулей

  • основная часть программы

  • код для тестирования

Исключения

Choices

  1. Install ghc 7.6.3 and Haskell Platform
  2. Install ghc 7.8.2 and Cabal

Option GHC 7.6.3 + Haskell Platform

GHC 7.6.3

Install Ubuntu 12.04 depencies:

@a1ip
a1ip / fish_prompt.fish
Last active September 21, 2021 00:57 — forked from KELiON/fish_prompt.fish
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
end
function _rb_prompt
echo (rvm info | awk '{print $1}')
# name: wkf
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for FISH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
## Set this options in your config.fish (if you want to :])
module RubyWarrior::Units
class Warrior < Base
def max_health
1000
end
end
end
class Player
def play_turn(warrior)
@a1ip
a1ip / config.fish
Last active August 29, 2015 14:07 — forked from andrewytliu/config.fish
# in ~/.config/fish/config.fish
# Load the default rubies
if test -z $rvm_bin_path
exec bash --login -c "exec fish"
end