Skip to content

Instantly share code, notes, and snippets.

View aristofun's full-sized avatar
🎯
veni, vidi, vici

Michael Butlitsky aristofun

🎯
veni, vidi, vici
View GitHub Profile
let message = 'Hello, world!';
debugger;
console.error(message);
// Код к видео про установку ноды
// © goodprogrammer.ru
class UsersController < ApplicationController
before_action :load_user, except: [:index, :new, :create]
before_action :authorize_user, except: [:index, :new, :create, :show]
def index
@users = User.all
end
def new
redirect_to root_url, alert: I18n.t(:logged_in) if current_user.present?
@aristofun
aristofun / kanobu.rb
Created February 17, 2018 10:18
Rock Paper Scissors Fire game
# Rock Paper Scissors Fire game
# Ruby 2.* recommended
# just run `ruby <this_file>` in terminal to play
#
# Returns 0 -- draw
# 1 -- player1 wins
# 2 -- player2 wins
def who_wins(player1, player2)
if %w(01 12 20 32 31 03).include?("#{player1}#{player2}")
return 1