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
| function parseTime (initialTime) { | |
| var time = parseInt(initialTime); | |
| var result = ''; | |
| if (time <= 59) { | |
| result = time > 9 ? '00:' + time : '00:0' + time; | |
| } else if (time > 59 && time <= 3599) { | |
| var minutes = 0; | |
| while (time > 59) { | |
| time -= 60; | |
| minutes += 1; |
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
| var express = require('express'); | |
| var path = require('path'); | |
| var favicon = require('serve-favicon'); | |
| var logger = require('morgan'); | |
| var cookieParser = require('cookie-parser'); | |
| var bodyParser = require('body-parser'); | |
| var routes = require('./routes/index'); | |
| var users = require('./routes/users'); |
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
| switch (condition) { | |
| case true: | |
| // Yes | |
| break; | |
| case false: | |
| // No | |
| break; | |
| default: | |
| // Maybe | |
| } |
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
| function! <SID>StripTrailingWhitespaces() | |
| " Preparation: save last search, and cursor position. | |
| let _s=@/ | |
| let l = line(".") | |
| let c = col(".") | |
| " Do the business: | |
| %s/\s\+$//e | |
| " Clean up: restore previous search history, and cursor position | |
| let @/=_s | |
| call cursor(l, c) |
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
| set nocompatible | |
| filetype off | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| Plugin 'gmarik/Vundle.vim' | |
| Plugin 'Valloric/YouCompleteMe' | |
| Plugin 'SirVer/ultisnips' | |
| Plugin 'godlygeek/tabular' |
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
| source ~/.vundle | |
| " -- DEFAULTS -- | |
| " UTF-8 encoding | |
| set encoding=utf-8 | |
| cd ~/Sites | |
| " Set leader key to , | |
| let mapleader="," | |
| " Don't close buffers, hide them |
NewerOlder