// OK
/users/1
/galleries/1/photos/23/comments
// prefer plural nouns, since GET /user Should respond with many users
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
module Subsets | |
( | |
subsets | |
) where | |
subsets :: [a] -> [[a]] | |
subsets [] = [[]] | |
subsets (x:xs) = subsets xs ++ map (x:) (subsets xs) |
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
package datastructures; | |
import java.util.Comparator; | |
public class BinomailHeap<K extends Comparable> { | |
private Node<K> head; | |
private int size; | |
private Comparator<K> comparator; |
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
import java.util.ArrayList; | |
import java.util.List; | |
class Main { | |
public static void main(String[] args) { | |
System.out.println( | |
tokenize( | |
("<html>\n" + | |
" <h1>content1</h1>\n" + | |
" <div>\n" + |
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
{ | |
"animation_enabled": false, | |
"close_windows_when_empty": true, | |
"default_line_ending": "unix", | |
"drag_text": false, | |
"ensure_newline_at_eof_on_save": true, | |
"fade_fold_buttons": false, | |
"fallback_encoding": "Cyrillic (Windows 1251)", | |
"font_face": "JetBrains Mono", | |
"font_options": |
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
// >= 0, <= 1_000_000 | |
// problem suggests that string can only contain 'million' | |
// or less -> million can occure only once and it's the whole string | |
const parseInt = (string) => | |
string.includes('million') | |
? 1000000 : parseMillion(string); | |
// < 1_000_000 | |
// if we have 'thousand' word in given string, | |
// split on it and solve parse left, multiply it by 1000 |
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
set nocompatible | |
filetype off | |
call plug#begin('~/.vim/plugged') | |
Plug 'junegunn/vim-easy-align' | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'flazz/vim-colorschemes' | |
Plug 'tpope/vim-surround' | |
call plug#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
{ | |
"telemetry.enableCrashReporter": false, | |
"telemetry.enableTelemetry": false, | |
"files.autoSave": "onFocusChange", | |
"editor.fontFamily": "'JetBrains Mono', Monaco, 'Courier New', monospace", | |
"editor.wordWrap": "on", | |
"[ruby]": { | |
"editor.tabSize": 2 | |
}, | |
"editor.fontLigatures": true, |
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
function git_branch() { | |
branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}') | |
if [[ $branch == "" ]]; then | |
: | |
else | |
echo "$branch " | |
fi | |
} | |
setopt prompt_subst | |
PROMPT='%B%F{240}%2~%f%b %F{red}$(git_branch)%f%(?.%#.%F{red}%#)%f ' |
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
class Sequence | |
def initialize(str) | |
@digits = str.chars.map(&:to_i) | |
end | |
def next | |
new_digits = [] | |
digit_repeats = 1 | |
@digits.each_cons(2) do |prev, curr| | |
if prev == curr |
NewerOlder