Skip to content

Instantly share code, notes, and snippets.

View v-kolesnikov's full-sized avatar
✍️
I'm writing something just now! You can write me too! 😉

Vasily Kolesnikov v-kolesnikov

✍️
I'm writing something just now! You can write me too! 😉
View GitHub Profile
; remove duplicates from sequence
; third
(defn compress [seq]
(->> seq
(reduce #(cond
(= %2 (first %1)) %1
:else (conj %1 %2))
nil)
(reverse)))
def client_platform
case request.env['HTTP_USER_AGENT']
when 'ios-app'
:ios
when 'droid-app'
:android
end
end
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 " вставить текст до курсора
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

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

s.split.map { |x| x.mb_chars.capitalize.to_s }.join(" ")