summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--amd.html.markdown203
-rw-r--r--bash.html.markdown9
-rw-r--r--de-de/haskell-de.html.markdown2
-rw-r--r--es-es/julia-es.html.markdown5
-rw-r--r--fr-fr/haskell.html.markdown2
-rw-r--r--fr-fr/lua-fr.html.markdown2
-rw-r--r--fr-fr/scala.html.markdown5
-rw-r--r--fr-fr/xml-fr.html.markdown127
-rw-r--r--haskell.html.markdown2
-rw-r--r--julia.html.markdown2
-rw-r--r--ko-kr/lua-kr.html.markdown2
-rw-r--r--ko-kr/php-kr.html.markdown2
-rw-r--r--lua.html.markdown2
-rw-r--r--perl6.html.markdown2
-rw-r--r--php.html.markdown2
-rw-r--r--pt-br/haskell-pt.html.markdown2
-rw-r--r--pt-br/php-pt.html.markdown2
-rw-r--r--ru-ru/coffeescript-ru.html.markdown104
-rw-r--r--ru-ru/haskell-ru.html.markdown2
-rw-r--r--ru-ru/julia-ru.html.markdown2
-rw-r--r--ru-ru/php-ru.html.markdown2
-rw-r--r--rust.html.markdown4
-rw-r--r--tmux.html.markdown180
-rw-r--r--tr-tr/php-tr.html.markdown2
-rw-r--r--zh-cn/c-cn.html.markdown4
-rw-r--r--zh-cn/haskell-cn.html.markdown2
-rw-r--r--zh-cn/julia-cn.html.markdown2
-rw-r--r--zh-cn/lua-cn.html.markdown2
-rw-r--r--zh-cn/php-cn.html.markdown2
29 files changed, 562 insertions, 119 deletions
diff --git a/amd.html.markdown b/amd.html.markdown
new file mode 100644
index 00000000..3500fa58
--- /dev/null
+++ b/amd.html.markdown
@@ -0,0 +1,203 @@
+---
+category: tool
+tool: amd
+contributors:
+ - ["Frederik Ring", "https://github.com/m90"]
+filename: learnamd.js
+---
+
+## Getting Started with AMD
+
+The **Asynchronous Module Definition** API specifies a mechanism for defining JavaScript modules such that the module and its dependencies can be asynchronously loaded. This is particularly well suited for the browser environment where synchronous loading of modules incurs performance, usability, debugging, and cross-domain access problems.
+
+### Basic concept
+```javascript
+// The basic AMD API consists of nothing but two methods: `define` and `require`
+// and is all about module definition and consumption:
+// `define(id?, dependencies?, factory)` defines a module
+// `require(dependencies, callback)` imports a set of dependencies and
+// consumes them in the passed callback
+
+// Let's start by using define to define a new named module
+// that has no dependencies. We'll do so by passing a name
+// and a factory function to define:
+define('awesomeAMD', function(){
+ var isAMDAwesome = function(){
+ return true;
+ };
+ // The return value of a module's factory function is
+ // what other modules or require calls will receive when
+ // requiring our `awesomeAMD` module.
+ // The exported value can be anything, (constructor) functions,
+ // objects, primitives, even undefined (although that won't help too much).
+ return isAMDAwesome;
+});
+
+// Now, let's define another module that depends upon our `awesomeAMD` module.
+// Notice that there's an additional argument defining our
+// module's dependencies now:
+define('loudmouth', ['awesomeAMD'], function(awesomeAMD){
+ // dependencies will be passed to the factory's arguments
+ // in the order they are specified
+ var tellEveryone = function(){
+ if (awesomeAMD()){
+ alert('This is sOoOo rad!');
+ } else {
+ alert('Pretty dull, isn\'t it?');
+ }
+ };
+ return tellEveryone;
+});
+
+// As we do know how to use define now, let's use `require` to
+// kick off our program. `require`'s signature is `(arrayOfDependencies, callback)`.
+require(['loudmouth'], function(loudmouth){
+ loudmouth();
+});
+
+// To make this tutorial running code, let's implement a very basic
+// (non-asynchronous) version of AMD right here on the spot:
+function define(name, deps, factory){
+ // notice how modules without dependencies are handled
+ define[name] = require(factory ? deps : [], factory || deps);
+}
+
+function require(deps, callback){
+ var args = [];
+ // first let's retrieve all the dependencies needed
+ // by the require call
+ for (var i = 0; i < deps.length; i++){
+ args[i] = define[deps[i]];
+ }
+ // satisfy all the callback's dependencies
+ return callback.apply(null, args);
+}
+// you can see this code in action here: http://jsfiddle.net/qap949pd/
+```
+
+### Real-world usage with require.js
+
+In contrast to the introductory example, `require.js` (the most popular AMD library) actually implements the **A** in **AMD**, enabling you to load modules and their dependencies asynchronously via XHR:
+
+```javascript
+/* file: app/main.js */
+require(['modules/someClass'], function(SomeClass){
+ // the callback is deferred until the dependency is loaded
+ var thing = new SomeClass();
+});
+console.log('So here we are, waiting!'); // this will run first
+```
+
+By convention, you usually store one module in one file. `require.js` can resolve module names based on file paths, so you don't have to name your modules, but can simply reference them using their location. In the example `someClass` is assumed to be in the `modules` folder, relative to your configuration's `baseUrl`:
+
+* app/
+ * main.js
+ * modules/
+ * someClass.js
+ * someHelpers.js
+ * ...
+ * daos/
+ * things.js
+ * ...
+
+This means we can define `someClass` without specifying a module id:
+
+```javascript
+/* file: app/modules/someClass.js */
+define(['daos/things', 'modules/someHelpers'], function(thingsDao, helpers){
+ // module definition, of course, will also happen asynchronously
+ function SomeClass(){
+ this.method = function(){/**/};
+ // ...
+ }
+ return SomeClass;
+});
+```
+To alter the default path mapping behavior use `requirejs.config(configObj)` in your `main.js`:
+
+```javascript
+/* file: main.js */
+requirejs.config({
+ baseUrl : 'app',
+ paths : {
+ // you can also load modules from other locations
+ jquery : '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min',
+ coolLibFromBower : '../bower_components/cool-lib/coollib'
+ }
+});
+require(['jquery', 'coolLibFromBower', 'modules/someHelpers'], function($, coolLib, helpers){
+ // a `main` file needs to call require at least once,
+ // otherwise no code will ever run
+ coolLib.doFancyStuffWith(helpers.transform($('#foo')));
+});
+```
+`require.js`-based apps will usually have a single entry point (`main.js`) that is passed to the `require.js` script tag as a data-attribute. It will be automatically loaded and executed on pageload:
+```html
+<!DOCTYPE html>
+<html>
+<head>
+ <title>A hundred script tags? Never again!</title>
+</head>
+<body>
+ <script src="require.js" data-main="app/main"></script>
+</body>
+</html>
+```
+
+### Optimizing a whole project using r.js
+
+Many people prefer using AMD for sane code organization during development, but still want to ship a single script file in production instead of performing hundreds of XHRs on page load.
+
+`require.js` comes with a script called `r.js` (that you will probably run in node.js, although Rhino is supported too) that can analyse your project's dependency graph, and build a single file containing all your modules (properly named), minified and ready for consumption.
+
+Install it using `npm`:
+```sh
+$ npm install requirejs -g
+```
+Now you can feed it with a configuration file:
+```sh
+$ r.js -o app.build.js
+```
+For our above example the configuration might look like:
+```javascript
+/* file : app.build.js */
+({
+ name : 'main', // name of the entry point
+ out : 'main-built.js', // name of the file to write the output to
+ baseUrl : 'app',
+ paths : {
+ // `empty:` tells r.js that this should still be loaded from the CDN, using
+ // the location specified in `main.js`
+ jquery : 'empty:',
+ coolLibFromBower : '../bower_components/cool-lib/coollib'
+ }
+})
+```
+To use the built file in production, simply swap `data-main`:
+```html
+<script src="require.js" data-main="app/main-built"></script>
+```
+An incredibly detailed [overview of build options](https://github.com/jrburke/r.js/blob/master/build/example.build.js) is available in the GitHub repo.
+
+### Topics not covered in this tutorial
+* [Loader plugins / transforms](http://requirejs.org/docs/plugins.html)
+* [CommonJS style loading and exporting](http://requirejs.org/docs/commonjs.html)
+* [Advanced configuration](http://requirejs.org/docs/api.html#config)
+* [Shim configuration (loading non-AMD modules)](http://requirejs.org/docs/api.html#config-shim)
+* [CSS loading and optimizing with require.js](http://requirejs.org/docs/optimization.html#onecss)
+* [Using almond.js for builds](https://github.com/jrburke/almond)
+
+### Further reading:
+
+* [Official Spec](https://github.com/amdjs/amdjs-api/wiki/AMD)
+* [Why AMD?](http://requirejs.org/docs/whyamd.html)
+* [Universal Module Definition](https://github.com/umdjs/umd)
+
+### Implementations:
+
+* [require.js](http://requirejs.org)
+* [dojo toolkit](http://dojotoolkit.org/documentation/tutorials/1.9/modules/)
+* [cujo.js](http://cujojs.com/)
+* [curl.js](https://github.com/cujojs/curl)
+* [lsjs](https://github.com/zazl/lsjs)
+* [mmd](https://github.com/alexlawrence/mmd)
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/fr-fr/scala.html.markdown b/fr-fr/scala.html.markdown
index da562138..a43edf16 100644
--- a/fr-fr/scala.html.markdown
+++ b/fr-fr/scala.html.markdown
@@ -1,12 +1,11 @@
---
language: Scala
-filename: learnscala.scala
contributors:
- ["George Petrov", "http://github.com/petrovg"]
- ["Dominic Bou-Samra", "http://dbousamra.github.com"]
translators:
- - ["Anne-Catherine Dehier", "https://github.com/spellart"]
-filename: learn.scala
+ - ["Anne-Catherine Dehier", "https://github.com/spellart"]
+filename: learnscala-fr.scala
lang: fr-fr
---
diff --git a/fr-fr/xml-fr.html.markdown b/fr-fr/xml-fr.html.markdown
new file mode 100644
index 00000000..d7e76892
--- /dev/null
+++ b/fr-fr/xml-fr.html.markdown
@@ -0,0 +1,127 @@
+---
+language: xml
+contributors:
+ - ["João Farias", "https://github.com/JoaoGFarias"]
+translators:
+ - ["Geoffrey Liu", "https://github.com/g-liu"]
+filename: learnxml.xml
+---
+
+XML est un langage de balisage conçu pour stocker et transporter les informations.
+
+Contrairement à HTML, XML ne spécifie pas comment afficher ou formater les informations, juste comment les porter.
+
+* La syntaxe XML
+
+```xml
+<!-- Les commentaires en XML ressemblent ceci -->
+
+<?xml version="1.0" encoding="UTF-8"?>
+<librairie>
+ <livre categorie="CUISINE">
+ <titre lang="en">Everyday Italian</titre>
+ <auteur>Giada De Laurentiis</auteur>
+ <an>2005</an>
+ <prix>30.00</prix>
+ </livre>
+ <livre categorie="ENFANTS">
+ <titre lang="en">Harry Potter</titre>
+ <auteur>J. K. Rowling</auteur>
+ <an>2005</an>
+ <prix>29.99</prix>
+ </livre>
+ <livre categorie="WEB">
+ <titre lang="en">Learning XML</titre>
+ <auteur>Erik T. Ray</auteur>
+ <an>2003</an>
+ <prix>39.95</prix>
+ </livre>
+</librairie>
+
+<!-- Ce qui suit est un fichier XML typique.
+ Il commence par une déclaration, qui informe certaines métadonnées (en option).
+
+XML utilise une structure arborescente. Ci-dessus, le nœud racine est «librairie», qui a
+   trois nœuds enfants, qui sont appelés «livres». Ces nœuds ont plus de nœuds enfants, et ainsi de suite ...
+
+On crée les nœuds avec des balises d'ouverture / fermeture, et les enfants sont les nœuds juste entre
+   les balises d'ouverture et de fermeture. -->
+
+
+<!-- XML porte deux types d'informations:
+ 1 - Les attributs -> les métadonnées sur un nœud.
+ Habituellement, l'analyseur XML utilise cette information pour bien stocker les données.
+ 2 - Les éléments -> les informations pures.
+ C'est ce que l'analyseur retrouvera du fichier XML.
+ Les éléments apparaissent entre les balises d'ouverture et de fermeture, sans parenthèses. -->
+
+
+<!-- Ci-dessous, un élément avec deux attributs -->
+<fichier type="gif" id="4293">ordinateur.gif</fichier>
+
+
+```
+
+* Un document bien formaté & le validation
+
+Un document XML est bien formaté s'il est syntaxiquement correct.
+Cependant, il est possible d'injecter plus de contraintes dans le document,
+en utilisant les définitions de documents, tels que les schémas DTD et XML.
+
+Un document XML qui suit une définition de document est dit valide,
+en ce qui concerne ce document.
+
+Avec cet outil, vous pouvez vérifier les données XML en dehors de la logique de l'application.
+
+```xml
+
+<!-- Ci-dessous, vous pouvez voir une version simplifiée du document de librairie,
+   avec l'addition de définition DTD. -->
+
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE note SYSTEM "Librairie.dtd">
+<librairie>
+ <livre categorie="CUISINE">
+ <titre>Everyday Italian</titre>
+ <prix>30.00</prix>
+ </livre>
+</librairie>
+
+<!-- Cette DTD pourrait être quelque chose comme: -->
+
+<!DOCTYPE note
+[
+<!ELEMENT librairie (livre+)>
+<!ELEMENT livre (titre,prix)>
+<!ATTLIST livre categorie CDATA "Littérature">
+<!ELEMENT titre (#PCDATA)>
+<!ELEMENT prix (#PCDATA)>
+]>
+
+<!-- La DTD commence par une déclaration.
+   Après, le nœud racine est déclaré, qui exige un ou plusieurs nœuds enfants.
+   Chaque «livre» doit contenir exactement un «titre» et «prix» et un attribut
+   appelé «catégorie», avec «littérature» comme valeur par défaut.
+   Les nœuds de «titre» et «prix» contiennent des informations de caractère analysés
+ (Anglais: «parsed character data») -->
+
+<!-- La DTD pourrait être déclarée dans le fichier XML lui-même -->
+
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE note
+[
+<!ELEMENT librairie (livre+)>
+<!ELEMENT livre (titre,prix)>
+<!ATTLIST livre categorie CDATA "Littérature">
+<!ELEMENT titre (#PCDATA)>
+<!ELEMENT prix (#PCDATA)>
+]>
+
+<librairie>
+ <livre categorie="CUISINE">
+ <titre>Everyday Italian</titre>
+ <prix>30.00</prix>
+ </livre>
+</librairie>
+```
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"]