Update
This commit is contained in:
parent
4873e97eff
commit
04ab1dabbf
33
sass.md
33
sass.md
|
@ -3,6 +3,39 @@ title: Sass
|
|||
layout: default
|
||||
---
|
||||
|
||||
### Color functions
|
||||
|
||||
rgb(r,g,b)
|
||||
rgba(r,g,b,a)
|
||||
rgba($color, a)
|
||||
|
||||
darken($color, 5%)
|
||||
lighten($color, 5%)
|
||||
saturate($color, 5%)
|
||||
desaturate($color, 5%)
|
||||
grayscale($color)
|
||||
|
||||
compliment($color)
|
||||
$invert(color)
|
||||
|
||||
mix($a, $b, 50%)
|
||||
|
||||
hue($color)
|
||||
saturation($color)
|
||||
lightness($color)
|
||||
alpha($color) /* aka opacity() */
|
||||
|
||||
fade-in($color, 0.5)
|
||||
fade-out($color, 0.5)
|
||||
|
||||
adjust-color($color, $blue: 5)
|
||||
adjust-color($color, $lightness: -30%)
|
||||
adjust-color($color, $alpha: -0.4)
|
||||
adjust-color($color, $hue: 30deg)
|
||||
adjust-hue($color, 15deg)
|
||||
|
||||
http://sass-lang.com/documentation/Sass/Script/Functions.html
|
||||
|
||||
### Compass: Sprites
|
||||
|
||||
@import compass/utilities/sprites
|
||||
|
|
|
@ -2,6 +2,48 @@
|
|||
title: Vimscript snippets
|
||||
---
|
||||
|
||||
## Functions
|
||||
|
||||
### Inspecting the buffer
|
||||
|
||||
getline('.')
|
||||
getline(1)
|
||||
getline(1, 0)
|
||||
line('.') " current line number
|
||||
search("^$") " next blank line
|
||||
|
||||
getcurpos() " [bufnum, lnum, col, off, curswant]
|
||||
getpos('.')
|
||||
|
||||
expand('<cword>') " word under cursor
|
||||
expand("%") " current file
|
||||
|
||||
### Command line
|
||||
|
||||
|
||||
|
||||
### Files
|
||||
|
||||
fnameescape("string")
|
||||
fnamemodify("main.c", ":p:h")
|
||||
filereadable(fname)
|
||||
fnamemodify(fname, ':e') " current file extension - see expand()
|
||||
getfsize('file.txt')
|
||||
getcwd()
|
||||
|
||||
### Math
|
||||
|
||||
fmod(9, 2) " modulus
|
||||
floor(1.84)
|
||||
ceil(1.84)
|
||||
abs(-0.5)
|
||||
|
||||
### Strings
|
||||
|
||||
if a =~ '\s*'
|
||||
|
||||
## Binding
|
||||
|
||||
### Bind function to key and command
|
||||
|
||||
command! YoFunctionHere call s:YoFunctionHere()
|
||||
|
@ -9,11 +51,33 @@ title: Vimscript snippets
|
|||
function! s:FunctionHere()
|
||||
endfunction
|
||||
|
||||
### Stuff
|
||||
## Executing
|
||||
|
||||
expand('<cword>') " word under cursor
|
||||
### Execute normal keystrokes
|
||||
|
||||
filereadable(fname)
|
||||
fnamemodify(fname, ':e') " current file extension - see expand()
|
||||
### Running commands
|
||||
|
||||
normal 'ddahello'
|
||||
exe 'normal ^C' " with expansions
|
||||
wincmd J
|
||||
|
||||
### Call a function in insert mode
|
||||
|
||||
inoremap X <CR>=script#myfunction()<CR>
|
||||
inoremap <F2> <C-R>=MyVimFunc()?'':''<CR>
|
||||
|
||||
### Checking plugins
|
||||
|
||||
if globpath(&rtp, "plugin/commentary.vim") != ""
|
||||
|
||||
## Autoload
|
||||
|
||||
" autoload/hello.vim
|
||||
if exists("g:hello_loaded") | finish | endif
|
||||
let g:hello_loaded=1
|
||||
|
||||
function hello#method()
|
||||
endfunction
|
||||
|
||||
" calling hello#method() will load only if autoload()
|
||||
|
||||
expand("%") " current file
|
||||
|
|
6
yargs.md
6
yargs.md
|
@ -23,7 +23,8 @@ var argv = require('yargs')
|
|||
.describe('v', 'show version information')
|
||||
|
||||
// help text
|
||||
.help('h')
|
||||
.alias('h', 'help')
|
||||
.help('help')
|
||||
.usage('Usage: $0 -x [num]')
|
||||
.showHelpOnFail(false, "Specify --help for available options")
|
||||
```
|
||||
|
@ -53,7 +54,8 @@ var argv = require('yargs')
|
|||
// more help
|
||||
.example('...')
|
||||
.epilog('copyright 2015')
|
||||
.command('start', start a server')
|
||||
.command('start', 'start a server')
|
||||
```
|
||||
|
||||
### Stacking
|
||||
|
||||
|
|
Loading…
Reference in New Issue