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
module Main where | |
import Effect (Effect) | |
import Effect.Console (logShow) | |
import TryPureScript (render, withConsole) | |
import Prelude (class Applicative, class Apply, class Bind, class Functor, class Monad, apply, bind, map, pure, (=<<), (<>)) | |
import Data.Eq ((==)) | |
import Data.Show |
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
FROM node:8-slim | |
ENV DEBIAN_FRONTEND noninteractive | |
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global | |
ENV PATH=/home/node/.npm-global/bin:$PATH | |
RUN apt-get -yq update && apt-get -yq install build-essential | |
USER node |
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
Привет всем. | |
Хочу продолжить [хорошее начинание](http://dou.ua/lenta/digests/ruby-digest-0/). Вот моя версия того, на что должен посмотреть новичок в Ruby и рельсах. | |
Первые книги | |
------------ | |
* [Practical Object-Oriented Design in Ruby: An Agile Primer](http://www.poodr.com/) by Sandi Metz - Отличная книга об объектно-ориентированном дизайне и связанных с ним аспектах. Автор рассматривает плюсы и минусы различных подходов, говорит о тестирование. | |
* [Agile Web Development with Rails 4](http://pragprog.com/book/rails4/agile-web-development-with-rails-4) by Sam Ruby, Dave Thomas and David Heinemeier Hansson - Новый Завет Rails от самого автора религии. |
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
# Server side | |
def deletable_by?(user) | |
user.owner? @project && initial? | |
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
require 'socket' | |
require 'net/https' | |
require 'uri' | |
require 'digest/sha1' | |
def fibonacci(n) | |
n < 2 ? n : fibonacci(n-1) + fibonacci(n-2) | |
end | |
def google_body |
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
#!/usr/bin/env ruby | |
# | |
###################################################################################################################################### | |
# Taken here http://fulloo.info/Examples/RubyExamples/Dijkstra/DijkstraListing.html and carefully corrected to be more ruby idiomatic. | |
###################################################################################################################################### | |
# | |
# Example in Ruby -- Dijkstra's algorithm in DCI | |
# Modified and simplified for a Manhattan geometry with 8 roles | |
# | |
# |
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
if callcc YesNoMessageBox.new('Some question') | |
a_role.do_some_stuff | |
else | |
other_role.do_other_stuff | |
end | |
user_input = callcc DialogBox.new('Other question') | |
a_role.do user_input |
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
class Human | |
attr_accessor :address | |
end | |
class Address | |
def to_s | |
"City: #{@city}" | |
end | |
private |