This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rails.application.routes.draw do | |
| mount_devise_token_auth_for 'User', at: 'auth', controllers: { | |
| sessions: 'overrides/sessions' | |
| } | |
| root 'application#angular' | |
| resource :messages | |
| # Redirect anything to root | |
| get '*path' => redirect('/') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| until $c == num | |
| find(c) | |
| c += 1 | |
| end | |
| # Тоже что и: | |
| while $c < nume | |
| find(c) | |
| c += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def find(n) | |
| unless n < 2 || n % 2 == 0 && n != 2 | |
| arr = [] | |
| n.times do |a| | |
| arr.push(a) if a < (Math.sqrt(n) + 1).floor && a > 1 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe 'Expectation Matchers' do | |
| describe 'equivalence matchers' do | |
| it 'will match loose equality with #eq' do | |
| a = "2 cats" | |
| b = "2 cats" | |
| expect(a).to eq(b) | |
| expect(a).to be == b # synonym for #eq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('filmer').directive 'document', -> | |
| template = () -> | |
| '<canvas id="editorWindow" style="background-color: rgba(255, 194, 93, 0.4)" width ="500px" height = "500px"></canvas>' | |
| getMousePos = (canvas, evt) -> | |
| rect = canvas.getBoundingClientRect() | |
| return { | |
| x: evt.clientX - rect.left | |
| y: evt.clientY - rect.top |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sum = 0 | |
| array = [1,2,3] | |
| array.each {|a| sum+=a} | |
| #array.each do |a| | |
| # sum+=a | |
| #end | |
| puts sum #--> 6 |
NewerOlder