diff options
-rw-r--r-- | bash.html.markdown | 9 | ||||
-rw-r--r-- | de-de/haskell-de.html.markdown | 2 | ||||
-rw-r--r-- | es-es/julia-es.html.markdown | 5 | ||||
-rw-r--r-- | fr-fr/haskell.html.markdown | 2 | ||||
-rw-r--r-- | fr-fr/lua-fr.html.markdown | 2 | ||||
-rw-r--r-- | haskell.html.markdown | 2 | ||||
-rw-r--r-- | julia.html.markdown | 2 | ||||
-rw-r--r-- | ko-kr/lua-kr.html.markdown | 2 | ||||
-rw-r--r-- | ko-kr/php-kr.html.markdown | 2 | ||||
-rw-r--r-- | lua.html.markdown | 2 | ||||
-rw-r--r-- | perl6.html.markdown | 2 | ||||
-rw-r--r-- | php.html.markdown | 2 | ||||
-rw-r--r-- | pt-br/haskell-pt.html.markdown | 2 | ||||
-rw-r--r-- | pt-br/php-pt.html.markdown | 2 | ||||
-rw-r--r-- | ru-ru/coffeescript-ru.html.markdown | 104 | ||||
-rw-r--r-- | ru-ru/haskell-ru.html.markdown | 2 | ||||
-rw-r--r-- | ru-ru/julia-ru.html.markdown | 2 | ||||
-rw-r--r-- | ru-ru/php-ru.html.markdown | 2 | ||||
-rw-r--r-- | rust.html.markdown | 4 | ||||
-rw-r--r-- | tmux.html.markdown | 180 | ||||
-rw-r--r-- | tr-tr/php-tr.html.markdown | 2 | ||||
-rw-r--r-- | zh-cn/c-cn.html.markdown | 4 | ||||
-rw-r--r-- | zh-cn/haskell-cn.html.markdown | 2 | ||||
-rw-r--r-- | zh-cn/julia-cn.html.markdown | 2 | ||||
-rw-r--r-- | zh-cn/lua-cn.html.markdown | 2 | ||||
-rw-r--r-- | zh-cn/php-cn.html.markdown | 2 |
26 files changed, 230 insertions, 116 deletions
diff --git a/bash.html.markdown b/bash.html.markdown index dc7d32b6..9b199b8c 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -9,6 +9,7 @@ contributors: - ["akirahirose", "https://twitter.com/akirahirose"] - ["Anton Strömkvist", "http://lutic.org/"] - ["Rahil Momin", "https://github.com/iamrahil"] + - ["Gregrory Kielian", "https://github.com/gskielian"] filename: LearnBash.sh --- @@ -199,4 +200,12 @@ sort file.txt uniq -d file.txt # prints only the first column before the ',' character cut -d ',' -f 1 file.txt +# replaces every occurrence of 'okay' with 'great' in file.txt, (regex compatible) +sed -i 's/okay/great/g' file.txt +# print to stdout all lines of file.txt which match some regex, the example prints lines which beginning with "foo" and end in "bar" +grep "^foo.*bar$" file.txt +# pass the option "-c" to instead print the number of lines matching the regex +grep -c "^foo.*bar$" file.txt +# if you literally want to search for the string, and not the regex, use fgrep (or grep -F) +fgrep "^foo.*bar$" file.txt ``` diff --git a/de-de/haskell-de.html.markdown b/de-de/haskell-de.html.markdown index df6267f9..2c548961 100644 --- a/de-de/haskell-de.html.markdown +++ b/de-de/haskell-de.html.markdown @@ -1,5 +1,5 @@ --- -language: haskell +language: Haskell lang: de-de contributors: - ["Adit Bhargava", "http://adit.io"] diff --git a/es-es/julia-es.html.markdown b/es-es/julia-es.html.markdown index 41a7c68b..203ee3bb 100644 --- a/es-es/julia-es.html.markdown +++ b/es-es/julia-es.html.markdown @@ -1,8 +1,9 @@ --- -language: julia +language: Julia contributors: - ["Leah Hanson", "http://leahhanson.us"] - - ["Guillermo Garza" ] +translators: + - ["Guillermo Garza", "http://github.com/ggarza"] filename: learnjulia-es.jl lang: es-es --- diff --git a/fr-fr/haskell.html.markdown b/fr-fr/haskell.html.markdown index 989db1d5..d9d3151f 100644 --- a/fr-fr/haskell.html.markdown +++ b/fr-fr/haskell.html.markdown @@ -1,5 +1,5 @@ --- -language: haskell +language: Haskell contributors: - ["Adit Bhargava", "http://adit.io"] translators: diff --git a/fr-fr/lua-fr.html.markdown b/fr-fr/lua-fr.html.markdown index 922d6ebc..b4e2a161 100644 --- a/fr-fr/lua-fr.html.markdown +++ b/fr-fr/lua-fr.html.markdown @@ -1,5 +1,5 @@ --- -language: lua +language: Lua filename: learnlua-fr.lua contributors: - ["Tyler Neylon", "http://tylerneylon.com/"] diff --git a/haskell.html.markdown b/haskell.html.markdown index e0489710..ad12de2a 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -1,5 +1,5 @@ --- -language: haskell +language: Haskell contributors: - ["Adit Bhargava", "http://adit.io"] --- diff --git a/julia.html.markdown b/julia.html.markdown index feb38463..3a52018c 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -1,5 +1,5 @@ --- -language: julia +language: Julia contributors: - ["Leah Hanson", "http://leahhanson.us"] filename: learnjulia.jl diff --git a/ko-kr/lua-kr.html.markdown b/ko-kr/lua-kr.html.markdown index 850587a0..b4a018ef 100644 --- a/ko-kr/lua-kr.html.markdown +++ b/ko-kr/lua-kr.html.markdown @@ -1,5 +1,5 @@ --- -language: lua +language: Lua category: language contributors: - ["Tyler Neylon", "http://tylerneylon.com/"] diff --git a/ko-kr/php-kr.html.markdown b/ko-kr/php-kr.html.markdown index 80f324f3..1f53221f 100644 --- a/ko-kr/php-kr.html.markdown +++ b/ko-kr/php-kr.html.markdown @@ -1,5 +1,5 @@ --- -language: php +language: PHP category: language contributors: - ["Malcolm Fell", "http://emarref.net/"] diff --git a/lua.html.markdown b/lua.html.markdown index be9f3141..0809215f 100644 --- a/lua.html.markdown +++ b/lua.html.markdown @@ -1,5 +1,5 @@ --- -language: lua +language: Lua contributors: - ["Tyler Neylon", "http://tylerneylon.com/"] filename: learnlua.lua diff --git a/perl6.html.markdown b/perl6.html.markdown index ee27ff42..52625bc2 100644 --- a/perl6.html.markdown +++ b/perl6.html.markdown @@ -64,7 +64,7 @@ say "Interpolate an array using [] : @array[]"; my @keys = 0, 2; @array[@keys] = @letters; # Assign using an array -say @array; #=> a 2 b +say @array; #=> a 6 b # There are two more kinds of lists: Parcel and Arrays. # Parcels are immutable lists (you can't modify a list that's not assigned). diff --git a/php.html.markdown b/php.html.markdown index e1bb86a0..039288a0 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -1,5 +1,5 @@ --- -language: php +language: PHP contributors: - ["Malcolm Fell", "http://emarref.net/"] - ["Trismegiste", "https://github.com/Trismegiste"] diff --git a/pt-br/haskell-pt.html.markdown b/pt-br/haskell-pt.html.markdown index 55f90bd6..788dc1d2 100644 --- a/pt-br/haskell-pt.html.markdown +++ b/pt-br/haskell-pt.html.markdown @@ -1,5 +1,5 @@ --- -language: haskell +language: Haskell contributors: - ["Adit Bhargava", "http://adit.io"] translators: diff --git a/pt-br/php-pt.html.markdown b/pt-br/php-pt.html.markdown index 344df43a..0e710742 100644 --- a/pt-br/php-pt.html.markdown +++ b/pt-br/php-pt.html.markdown @@ -1,5 +1,5 @@ --- -language: php +language: PHP contributors: - ["Malcolm Fell", "http://emarref.net/"] - ["Trismegiste", "https://github.com/Trismegiste"] diff --git a/ru-ru/coffeescript-ru.html.markdown b/ru-ru/coffeescript-ru.html.markdown new file mode 100644 index 00000000..f8416f38 --- /dev/null +++ b/ru-ru/coffeescript-ru.html.markdown @@ -0,0 +1,104 @@ +--- +language: coffeescript +contributors: + - ["Tenor Biel", "http://github.com/L8D"] + - ["Xavier Yao", "http://github.com/xavieryao"] +translators: + - ["asaskevich", "http://github.com/asaskevich"] +filename: learncoffee-ru.coffee +lang: ru-ru +--- + +CoffeeScript - это небольшой язык, который компилируется один-в-один в эквивалентный код на языке JavaScript, а потому он не интерпретируется во время исполнения JavaScript кода. +Ключевой особенностью CoffeeScript является то, что он пытается создать читабельный, качественно оформленный и плавный JavaScript код, прекрасно работающий в любой среде JavaScript. + +Также загляните на официальный сайт [языка](http://coffeescript.org/), где можно найти весьма полное учебное пособие по CoffeeScript. + +```coffeescript +# CoffeeScript - язык хипстеров. +# Язык использует самое модное из множества современных языков. +# Эти комментарии по стилю похожи на комментарии Ruby или Python, они используют "решетку" в качестве знака комментария. + +### +Блоки комментариев выделяются тремя символами "решетки", в результирующем JavaScript коде они будут преобразованы в '/ * и '* /'. + +Перед тем, как идти далее, Вам нужно понимать семантику JavaScript. +### + +# Присвоение: +number = 42 #=> var number = 42; +opposite = true #=> var opposite = true; + +# Условия: +number = -42 if opposite #=> if(opposite) { number = -42; } + +# Функции: +square = (x) -> x * x #=> var square = function(x) { return x * x; } + +fill = (container, liquid = "coffee") -> + "Заполняем #{container} жидкостью #{liquid}..." +#=>var fill; +# +#fill = function(container, liquid) { +# if (liquid == null) { +# liquid = "coffee"; +# } +# return "Заполняем " + container + " жидкостью " + liquid + "..."; +#}; + +# Списки и диапазоны: +list = [1..5] #=> var list = [1, 2, 3, 4, 5]; + +# Объекты: +math = + root: Math.sqrt + square: square + cube: (x) -> x * square x +#=> var math = { +# "root": Math.sqrt, +# "square": square, +# "cube": function(x) { return x * square(x); } +#} + +# Многоточия: +race = (winner, runners...) -> + print winner, runners +#=>race = function() { +# var runners, winner; +# winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : []; +# return print(winner, runners); +#}; + +# Проверка на существование объекта: +alert "Так и знал!" if elvis? +#=> if(typeof elvis !== "undefined" && elvis !== null) { alert("Так и знал!"); } + +# Итерации по массивам: +cubes = (math.cube num for num in list) +#=>cubes = (function() { +# var _i, _len, _results; +# _results = []; +# for (_i = 0, _len = list.length; _i < _len; _i++) { +# num = list[_i]; +# _results.push(math.cube(num)); +# } +# return _results; +# })(); + +foods = ['broccoli', 'spinach', 'chocolate'] +eat food for food in foods when food isnt 'chocolate' +#=>foods = ['broccoli', 'spinach', 'chocolate']; +# +#for (_k = 0, _len2 = foods.length; _k < _len2; _k++) { +# food = foods[_k]; +# if (food !== 'chocolate') { +# eat(food); +# } +#} +``` + +## На почитать + +- [Smooth CoffeeScript](http://autotelicum.github.io/Smooth-CoffeeScript/) +- [CoffeeScript Ristretto](https://leanpub.com/coffeescript-ristretto/read) +- [CoffeeScript на русском](http://cidocs.ru/coffeescript/) diff --git a/ru-ru/haskell-ru.html.markdown b/ru-ru/haskell-ru.html.markdown index 03e66d05..e15fe6b7 100644 --- a/ru-ru/haskell-ru.html.markdown +++ b/ru-ru/haskell-ru.html.markdown @@ -1,5 +1,5 @@ --- -language: haskell +language: Haskell contributors: - ["Adit Bhargava", "http://adit.io"] translators: diff --git a/ru-ru/julia-ru.html.markdown b/ru-ru/julia-ru.html.markdown index cd55e116..29392604 100644 --- a/ru-ru/julia-ru.html.markdown +++ b/ru-ru/julia-ru.html.markdown @@ -1,5 +1,5 @@ --- -language: julia +language: Julia contributors: - ["Leah Hanson", "http://leahhanson.us"] translators: diff --git a/ru-ru/php-ru.html.markdown b/ru-ru/php-ru.html.markdown index edcac4dd..53b2f916 100644 --- a/ru-ru/php-ru.html.markdown +++ b/ru-ru/php-ru.html.markdown @@ -1,5 +1,5 @@ --- -language: php +language: PHP contributors: - ["Malcolm Fell", "http://emarref.net/"] - ["Trismegiste", "https://github.com/Trismegiste"] diff --git a/rust.html.markdown b/rust.html.markdown index 0b9a5e58..3717a7d9 100644 --- a/rust.html.markdown +++ b/rust.html.markdown @@ -255,8 +255,8 @@ fn main() { ## Further reading There’s a lot more to Rust—this is just the basics of Rust so you can -understand the most important things. To learn more about Rust, read the -[Rust tutorial](http://doc.rust-lang.org/tutorial.html) and check out the +understand the most important things. To learn more about Rust, read [The Rust +Guide](http://doc.rust-lang.org/guide.html) and check out the [/r/rust](http://reddit.com/r/rust) subreddit. The folks on the #rust channel on irc.mozilla.org are also always keen to help newcomers. diff --git a/tmux.html.markdown b/tmux.html.markdown index 8d7aa752..ebc312ed 100644 --- a/tmux.html.markdown +++ b/tmux.html.markdown @@ -2,22 +2,23 @@ category: tool tool: tmux contributors: - - ["kaernyk", "http://github.com/kaernyk"] + - ["kaernyk", "https://github.com/kaernyk"] + - ["jmaud", "https://github.com/jmaud"] filename: LearnTmux.txt --- <a href="http://tmux.sourceforge.net/"> -tmux</a> is a terminal multiplexer: it enables a number of terminals -to be created, accessed, and controlled from a single screen. tmux +tmux</a> is a terminal multiplexer: it enables a number of terminals +to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background then later reattached. ``` + tmux [command] # Run a command - # 'tmux' with no commands will create a new - session + # 'tmux' with no commands will create a new session new # Create a new session -s "Session" # Create named session @@ -54,7 +55,7 @@ then later reattached. ## Key Bindings -# The method of controlling an attached tmux session is via key +# The method of controlling an attached tmux session is via key # combinations called 'Prefix' keys. ---------------------------------------------------------------------- @@ -63,47 +64,48 @@ then later reattached. (M-1) = Meta + 1 -or- Alt + 1 ---------------------------------------------------------------------- - ? # List all key bindings - : # Enter the tmux command prompt - r # Force redraw of the attached client - c # Create a new window + ? # List all key bindings + : # Enter the tmux command prompt + r # Force redraw of the attached client + c # Create a new window - ! # Break the current pane out of the window. - % # Split the current pane into two, left and right - " # Split the current pane into two, top and bottom + ! # Break the current pane out of the window. + % # Split the current pane into two, left and right + " # Split the current pane into two, top and bottom - n # Change to the next window - p # Change to the previous window - { # Swap the current pane with the previous pane - } # Swap the current pane with the next pane + n # Change to the next window + p # Change to the previous window + { # Swap the current pane with the previous pane + } # Swap the current pane with the next pane - s # Select a new session for the attached client + s # Select a new session for the attached client interactively - w # Choose the current window interactively - 0 to 9 # Select windows 0 to 9 + w # Choose the current window interactively + 0 to 9 # Select windows 0 to 9 - d # Detach the current client - D # Choose a client to detach + d # Detach the current client + D # Choose a client to detach - & # Kill the current window - x # Kill the current pane + & # Kill the current window + x # Kill the current pane - Up, Down # Change to the pane above, below, left, or right - Left, Right + Up, Down # Change to the pane above, below, left, or right + Left, Right - M-1 to M-5 # Arrange panes: - # 1) even-horizontal - # 2) even-vertical - # 3) main-horizontal - # 4) main-vertical - # 5) tiled + M-1 to M-5 # Arrange panes: + # 1) even-horizontal + # 2) even-vertical + # 3) main-horizontal + # 4) main-vertical + # 5) tiled - C-Up, C-Down # Resize the current pane in steps of one cell - C-Left, C-Right + C-Up, C-Down # Resize the current pane in steps of one cell + C-Left, C-Right - M-Up, M-Down # Resize the current pane in steps of five cells - M-Left, M-Right + M-Up, M-Down # Resize the current pane in steps of five cells + M-Left, M-Right +``` ### Configuring ~/.tmux.conf @@ -111,30 +113,59 @@ then later reattached. tmux.conf can be used to set options automatically on start up, much like how .vimrc or init.el are used. + +``` # Example tmux.conf -# 2014.9 +# 2014.10 + + +### General +########################################################################### + +# Enable UTF-8 +setw -g utf8 on +set-option -g status-utf8 on + +# Scrollback/History limit +set -g history-limit 2048 + +# Index Start +set -g base-index 1 + +# Mouse +set-option -g mouse-select-pane on + +# Force reload of config file +unbind r +bind r source-file ~/.tmux.conf ### Keybinds -###################################################################### +########################################################################### # Unbind C-b as the default prefix -unbind-key C-befix C-a +unbind C-b + +# Set new default prefix +set-option -g prefix ` # Return to previous window when prefix is pressed twice -bind-key C-a last-window -bind-key ` last-window +bind C-a last-window +bind ` last-window # Allow swapping C-a and ` using F11/F12 -bind-key F11 set-option -g prefix C-a -bind-key F12 set-option -g prefix ` +bind F11 set-option -g prefix C-a +bind F12 set-option -g prefix ` -# Activate inner-most session (when nesting tmux) -# to send commands -bind-key a send-prefix +# Keybind preference +setw -g mode-keys vi +set-option -g status-keys vi -# Index Start -set -g base-index 1 +# Moving between panes with vim movement keys +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R # Window Cycle/Swap bind e previous-window @@ -142,23 +173,20 @@ bind f next-window bind E swap-window -t -1 bind F swap-window -t +1 -# easy-to-remember split pane commands -bind | split-window -h +# Easy split pane commands +bind = split-window -h bind - split-window -v unbind '"' unbind % -# moving between panes with vim movement keys -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R +# Activate inner-most session (when nesting tmux) to send commands +bind a send-prefix ### Theme -##################################################################### +########################################################################### -# Statusbar Color Palette +# Statusbar Color Palatte set-option -g status-justify left set-option -g status-bg black set-option -g status-fg white @@ -187,14 +215,7 @@ setw -g window-status-activity-fg yellow ### UI -###################################################################### - -# Statusbar -set-option -g status-utf8 on - -# Keybind preference -setw -g mode-keys vi -set-option -g status-keys vi +########################################################################### # Notification setw -g monitor-activity on @@ -202,41 +223,20 @@ set -g visual-activity on set-option -g bell-action any set-option -g visual-bell off -# Mouse -setw -g mode-mouse on -set-option -g mouse-select-pane on -set -g mouse-resize-pane on -set -g mouse-select-window on - # Automatically set window titles set-option -g set-titles on - -# window number,program name,active (or not) -set-option -g set-titles-string '#H:#S.#I.#P #W #T' +set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not) # Statusbar Adjustments -set -g status-left '#[fg=red]#H#[fg=green]:#[fg=white]#S #[fg=green]][#[default]' -set -g status-interval 3 - -# Statusbar with right-aligned Date / Time -#set -g status-right '#[fg=green]][#[fg=white] #T #[fg=green]][ #[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default]' +set -g status-left "#[fg=red] #H#[fg=green]:#[fg=white]#S#[fg=green] |#[default]" # Show performance counters in statusbar # Requires https://github.com/thewtex/tmux-mem-cpu-load/ -#set -g status-right '#[fg=green]][#[fg=white] #(tmux-mem-cpu-load 5 4) #[fg=green]][ #[fg=yellow]%H:%M#[default]' +set -g status-interval 4 +set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | #[fg=cyan]%H:%M #[default]" - -### Misc -###################################################################### - -# Scrollback/History limit -set -g history-limit 4096 - -bind r source-file ~/.tmux.conf ``` -### External Resources - <a href="http://tmux.sourceforge.net/">Tmux | Home</a><br> <a href="http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux">Tmux Manual page</a><br> <a href="http://wiki.gentoo.org/wiki/Tmux">Archlinux Wiki</a><br> diff --git a/tr-tr/php-tr.html.markdown b/tr-tr/php-tr.html.markdown index 3db437cf..5258d785 100644 --- a/tr-tr/php-tr.html.markdown +++ b/tr-tr/php-tr.html.markdown @@ -1,5 +1,5 @@ --- -language: php +language: PHP filename: learnphp-tr.php contributors: - ["Malcolm Fell", "http://emarref.net/"] diff --git a/zh-cn/c-cn.html.markdown b/zh-cn/c-cn.html.markdown index 223f6e35..1e10416e 100644 --- a/zh-cn/c-cn.html.markdown +++ b/zh-cn/c-cn.html.markdown @@ -566,7 +566,7 @@ typedef void (*my_fnp_type)(char *); '\'' // 单引号 '\"' // 双引号 '\xhh' // 十六进制数字. 例子: '\xb' = vertical tab -'\ooo' // 十进制数字. 例子: '\013' = vertical tab +'\ooo' // 八进制数字. 例子: '\013' = vertical tab // 打印格式: "%d" // 整数 @@ -579,7 +579,7 @@ typedef void (*my_fnp_type)(char *); "%c" // 字母 "%p" // 指针 "%x" // 十六进制 -"%o" // 十进制 +"%o" // 八进制 "%%" // 打印 % /////////////////////////////////////// diff --git a/zh-cn/haskell-cn.html.markdown b/zh-cn/haskell-cn.html.markdown index 8d51f144..cb7ccdee 100644 --- a/zh-cn/haskell-cn.html.markdown +++ b/zh-cn/haskell-cn.html.markdown @@ -1,5 +1,5 @@ --- -language: haskell +language: Haskell filename: learn-haskell-zh.hs contributors: - ["Adit Bhargava", "http://adit.io"] diff --git a/zh-cn/julia-cn.html.markdown b/zh-cn/julia-cn.html.markdown index 7afc9043..1f91d52c 100644 --- a/zh-cn/julia-cn.html.markdown +++ b/zh-cn/julia-cn.html.markdown @@ -1,5 +1,5 @@ --- -language: julia +language: Julia filename: learn-julia-zh.jl contributors: - ["Jichao Ouyang", "http://oyanglul.us"] diff --git a/zh-cn/lua-cn.html.markdown b/zh-cn/lua-cn.html.markdown index 3ba098ec..53a603a2 100644 --- a/zh-cn/lua-cn.html.markdown +++ b/zh-cn/lua-cn.html.markdown @@ -1,5 +1,5 @@ --- -language: lua +language: Lua lang: zh-cn contributors: - ["Tyler Neylon", "http://tylerneylon.com/"] diff --git a/zh-cn/php-cn.html.markdown b/zh-cn/php-cn.html.markdown index 24939681..2def7f1c 100644 --- a/zh-cn/php-cn.html.markdown +++ b/zh-cn/php-cn.html.markdown @@ -1,5 +1,5 @@ --- -language: php +language: PHP contributors: - ["Malcolm Fell", "http://emarref.net/"] - ["Trismegiste", "https://github.com/Trismegiste"] |