The coding challenge is optional if you already have some code that you're proud of and can share with us.
If you have existing code, please follow the following guidelines:
The coding challenge is optional if you already have some code that you're proud of and can share with us.
If you have existing code, please follow the following guidelines:
| " Load pathogen plugins and reload their help files call pathogen#infect() call pathogen#helptags() " Set leader key to space nmap <Space> <NOP> let mapleader = "\<Space>"" " Indent with 2 spaces set shiftwidth=2 set softtabstop=2 set tabstop=2 set expandtab " Set width to 85 chars set textwidth=85 " Highlight things you've searched for, and press enter or - to un-highlight set hlsearch noremap - -:nohl<cr> noremap <cr> <cr>:nohl<cr> " Highlight matching braces/parenthesis set showmatch set matchtime=1 " Syntax highlighting syntax on au BufNewFile,BufRead *.tmpl set filetype=html " Wait for .5 sec before deciding you weren't trying a key sequence set timeoutlen=500 " Improved tab completion when using :e to open a file, etc. set wildmode=list:longest set wildignore+=*.class " (optional) Keep buffers open in memory (preserve undo history, etc) and just hide them when you close them (but not fugitive buffers) set hidden autocmd BufReadPost fugitive://* set bufhidden=delete " Ignore case when searching |
| tracking = DateTime.strptime(row['tracking'], '%Y%m%d%H%M%S') | |
| Correspondence.where( | |
| tracking: tracking, | |
| sender: row['remetente'], | |
| receiver: row['destinatario']).first_or_create( | |
| tracking: tracking, | |
| sender: row['remetente'], | |
| receiver: row['destinatario'], | |
| department: row['depto'], | |
| bay: row['baia'], |
| #!/bin/bash | |
| $* # Run the program passed in the args | |
| EXIT=$? # Preserve the exit status | |
| read -p "Press ENTER to exit." | |
| exit $EXIT |
| def seed | |
| 1 # standing in for a non-numeric object that also responds to #next | |
| end | |
| # missing: Return enough items fill an array of existing items so that it has 10 | |
| # (multiple implementations) | |
| # Test: assert_equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], missing([])) | |
| # Test: assert_equal([9, 10], missing([1, 2, 3, 4, 5, 6, 7, 8])) | |
| # @param queue: an Array with up to 10 items |
| " Load pathogen plugins and reload their help files | |
| call pathogen#infect() | |
| call pathogen#helptags() | |
| " Set leader key to space | |
| nmap <Space> <NOP> | |
| let mapleader = "\<Space>"" | |
| " Indent with 2 spaces | |
| set shiftwidth=2 |
| #!/bin/bash | |
| set -e | |
| git reflog -n100 --pretty='%cr|%gs' --grep-reflog='checkout: moving' HEAD | { | |
| seen=":" | |
| git_dir="$(git rev-parse --git-dir)" | |
| while read line; do | |
| date="${line%%|*}" | |
| branch="${line##* }" | |
| if ! [[ $seen == *:"${branch}":* ]]; then |
This gem is great. Thanks for releasing it!
We're running into 2 issues using Values, however.
ValueClass.withWhat I'm suggesting is a significant deviation from current usage and would require a major version release. That said, I think the benefits are worth it. Please review these ideas, and let me know if you would consider accepting these changes into the project, providing that the changes are simple and elegant enough to stay in line with the project's goal for simplicity. If not, we'll fork and release under a different name.
Inheritance
I'm struggling to balance encapsulation with managing side effects in a specific scenario described here.
< ActiveRecord::Base (side-effect-based class methods, value-based instances) stores user parameters for price calculations| ~ $ uname -a | |
| Linux v 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux | |
| ~ $ unzip mjruby_linux_bin.zip | |
| Archive: mjruby_linux_bin.zip | |
| inflating: mjruby | |
| ~ $ ls -l ./mjruby | |
| -rwxr-xr-x 1 nilbus nilbus 498245 Aug 10 14:13 ./mjruby |