Курс: Урок: Модуль:
This file contains 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
; remove duplicates from sequence | |
; third | |
(defn compress [seq] | |
(->> seq | |
(reduce #(cond | |
(= %2 (first %1)) %1 | |
:else (conj %1 %2)) | |
nil) | |
(reverse))) | |
This file contains 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 client_platform | |
case request.env['HTTP_USER_AGENT'] | |
when 'ios-app' | |
:ios | |
when 'droid-app' | |
:android | |
end | |
end |
This file contains 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 "zip/zip" | |
# Usage: | |
# directory_to_zip = "/tmp/input" | |
# output_file = "/tmp/out.zip" | |
# zf = ZipFileGenerator.new(directoryToZip, output_file).write | |
class ZipFileGenerator | |
EXCLUDED_ENTRIES = [".", "..", ".git"] | |
def initialize(input_dir, output_file) |
i " вставить текст до курсора
This file contains 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
Wrangling Parentheses | |
The most effective way to edit Clojure code is structurally with paredit.vim, but if you don't have time to learn that, Vim still brings a lot to the table for dealing with all the parentheses in Clojure code. | |
First, obviously, the % motion (:help %) is very useful. In normal mode, put the cursor on an opening or closing paren and you can: | |
Hit % to jump to the matching paren. | |
Hit d% to delete the parens and everything they contain. | |
Hit y% to "yank"/copy the parens and everything in them. | |
Hit c% to delete the parens and the text they contain and start editing. | |
Hit v% to select the parens and the text they contain visually. |
- Dispath vs tslime for rspec
- Quick block convert with blockle conflict to buffergator
As configured in my dotfiles.
start new:
tmux
start new with session name:
1-9 | 10-19 | 20-29 | 30-39 | 40-46 |
---|
|[Упражнение 1.10](./ex_1_10.md)|[Упражнение 1.20](./ex_1_20.md)|[Упражнение 1.30](./ex_1_30.md)|[Упражнение 1.40](./ex_1_40.md)
Упражнение 1.1 |Упражнение 1.11|Упражнение 1.21|Упражнение 1.31|Упражнение 1.41 Упражнение 1.2 |Упражнение 1.12|Упражнение 1.22|Упражнение 1.32|Упражнение 1.42 Упражнение 1.3 |Упражнение 1.13|Упражнение 1.23|Упражнение 1.33|Упражнение 1.43 Упражнение 1.4 |[Упражнение 1.14](./ex_1_14.md
This file contains 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
s.split.map { |x| x.mb_chars.capitalize.to_s }.join(" ") |