From 5e594796156eae02b93ea5db4b991928069882c8 Mon Sep 17 00:00:00 2001 From: Joel Lovera Date: Wed, 10 Aug 2016 01:42:50 -0400 Subject: [PATCH] add support writers --- CONTRIBUTING.md | 1 + POST_TEMPLATE.md | 2 ++ README.md | 3 ++ _layouts/post.html | 9 +++++- .../2015-12-29-insert-item-inside-an-array.md | 2 +- .../2016-01-01-angularjs-digest-vs-apply.md | 1 + ...ys-in-children-components-are-important.md | 1 + ...orting-strings-with-accented-characters.md | 1 + ...-differences-between-undefined-and-null.md | 1 + ...1-10-check-if-a-property-is-in-a-object.md | 1 + ...escue-adding-order-to-object-properties.md | 1 + ...g-multidimensional-arrays-in-javascript.md | 1 + ...lculate-the-max-min-value-from-an-array.md | 1 + ...-02-15-detect-document-ready-in-pure-js.md | 1 + _posts/en/2016-08-02-copy-to-clipboard.md | 1 + .../2015-12-29-insert-item-inside-an-array.md | 1 + .../2016-01-01-angularjs-digest-vs-apply.md | 1 + ...ys-in-children-components-are-important.md | 1 + ...orting-strings-with-accented-characters.md | 1 + ...-differences-between-undefined-and-null.md | 1 + ...1-10-check-if-a-property-is-in-a-object.md | 1 + ...escue-adding-order-to-object-properties.md | 1 + ...g-multidimensional-arrays-in-javascript.md | 1 + ...lculate-the-max-min-value-from-an-array.md | 1 + ...-02-15-detect-document-ready-in-pure-js.md | 1 + .../2015-12-29-insert-item-inside-an-array.md | 2 +- .../2016-01-01-angularjs-digest-vs-apply.md | 2 +- ...ys-in-children-components-are-important.md | 1 + ...orting-strings-with-accented-characters.md | 1 + ...-differences-between-undefined-and-null.md | 1 + ...1-10-check-if-a-property-is-in-a-object.md | 1 + ...escue-adding-order-to-object-properties.md | 1 + ...g-multidimensional-arrays-in-javascript.md | 1 + ...lculate-the-max-min-value-from-an-array.md | 1 + ...-02-15-detect-document-ready-in-pure-js.md | 1 + _posts/zh_CN/2016-08-02-copy-to-clipboard.md | 1 + .../2015-12-29-insert-item-inside-an-array.md | 1 + .../2016-01-01-angularjs-digest-vs-apply.md | 1 + ...ys-in-children-components-are-important.md | 1 + ...orting-strings-with-accented-characters.md | 1 + ...-differences-between-undefined-and-null.md | 1 + ...escue-adding-order-to-object-properties.md | 1 + ...g-multidimensional-arrays-in-javascript.md | 2 +- ...lculate-the-max-min-value-from-an-array.md | 1 + ...-02-15-detect-document-ready-in-pure-js.md | 1 + _posts/zh_TW/2016-08-02-copy-to-clipboard.md | 1 + about.md | 3 ++ style.scss | 30 +++++++++++++++++++ 48 files changed, 89 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ccf4cc47..d8909ce0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,7 @@ Use [this format](https://github.com/loverajoel/jstips/blob/gh-pages/POST_TEMPLA - Mark JS code with ```js - Don't mention "JavaScript" in the title (as our tips are about it anyway) - Use backticks (`) to mark code in the **title** and/or **tip-tldr** fields. _Warning_: Both values must not start with backticks! +- **Tip**, if you want, you can add your url (Paypal, Coinbase, etc ) in **tip-writer-support** field and receive the congratulations of readers. If you have an old tip, you can add it and send a PR. Once your tip is ready, [issue a pull request](https://help.github.com/articles/using-pull-requests/) with this [PR template](https://github.com/loverajoel/jstips/blob/gh-pages/PULL_REQUEST_TEMPLATE.md) and your tip will be reviewed (see below). diff --git a/POST_TEMPLATE.md b/POST_TEMPLATE.md index a0841408..6dba5e29 100644 --- a/POST_TEMPLATE.md +++ b/POST_TEMPLATE.md @@ -6,6 +6,8 @@ tip-number: xx tip-username: tip_js tip-username-profile: https://twitter.com/tips_js tip-tldr: Just a demo + + categories: - en diff --git a/README.md b/README.md index 7d53a323..2d75f57e 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ This is an awesome project about short and useful JavaScript tips that will allo Tips are added frequently (read further if you want to stay in touch). +## Support the community +Well, if you like a tip or a writer, if you read in a specific language, you can support the writer and translator. Just send a tip and let them know the awesome work that they are doing! + ### Can you help us enrich it? Sure, you can help the project in two ways, sending your tip or reviewing future tips. Any improvements or suggestions are more than welcome! diff --git a/_layouts/post.html b/_layouts/post.html index e2717e85..ff4f3291 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,7 +1,6 @@ --- layout: default is_post: true -joel: hola ---
@@ -20,6 +19,14 @@

+ {% if page.tip-writer-support %} + + {% endif %} + + {% if page.tip-translator-support %} + + {% endif %} + diff --git a/_posts/en/2015-12-29-insert-item-inside-an-array.md b/_posts/en/2015-12-29-insert-item-inside-an-array.md index 6184725f..d98107ec 100644 --- a/_posts/en/2015-12-29-insert-item-inside-an-array.md +++ b/_posts/en/2015-12-29-insert-item-inside-an-array.md @@ -6,7 +6,7 @@ tip-number: 00 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: Inserting an item into an existing array is a daily common task. You can add elements to the end of an array using push, to the beginning using unshift, or to the middle using splice. - +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/en/2016-01-01-angularjs-digest-vs-apply.md b/_posts/en/2016-01-01-angularjs-digest-vs-apply.md index 14d51a09..726ff310 100644 --- a/_posts/en/2016-01-01-angularjs-digest-vs-apply.md +++ b/_posts/en/2016-01-01-angularjs-digest-vs-apply.md @@ -6,6 +6,7 @@ tip-number: 01 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: JavaScript modules and build steps are getting more numerous and complicated, but what about boilerplate in new frameworks? +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/en/2016-01-02-keys-in-children-components-are-important.md b/_posts/en/2016-01-02-keys-in-children-components-are-important.md index 4a1f5866..37304500 100644 --- a/_posts/en/2016-01-02-keys-in-children-components-are-important.md +++ b/_posts/en/2016-01-02-keys-in-children-components-are-important.md @@ -6,6 +6,7 @@ tip-number: 02 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: The key is an attribute that you must pass to all components created dynamically from an array. It's a unique and constant id that React uses to identify each component in the DOM and to know whether it's a different component or the same one. Using keys ensures that the child component is preserved and not recreated and prevents weird things from happening. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/en/2016-01-04-sorting-strings-with-accented-characters.md b/_posts/en/2016-01-04-sorting-strings-with-accented-characters.md index 68761492..e64afee4 100644 --- a/_posts/en/2016-01-04-sorting-strings-with-accented-characters.md +++ b/_posts/en/2016-01-04-sorting-strings-with-accented-characters.md @@ -6,6 +6,7 @@ tip-number: 04 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: Javascript has a native method **sort** that allows sorting arrays. Doing a simple `array.sort()` will treat each array entry as a string and sort it alphabetically. But when you try order an array of non ASCII characters you will obtain a strange result. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/en/2016-01-05-differences-between-undefined-and-null.md b/_posts/en/2016-01-05-differences-between-undefined-and-null.md index 000c6360..ca1f9e52 100644 --- a/_posts/en/2016-01-05-differences-between-undefined-and-null.md +++ b/_posts/en/2016-01-05-differences-between-undefined-and-null.md @@ -6,6 +6,7 @@ tip-number: 05 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: Understanding the differences between `undefined` and `null`. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/en/2016-01-10-check-if-a-property-is-in-a-object.md b/_posts/en/2016-01-10-check-if-a-property-is-in-a-object.md index 9ceaca4a..4384e5b4 100644 --- a/_posts/en/2016-01-10-check-if-a-property-is-in-a-object.md +++ b/_posts/en/2016-01-10-check-if-a-property-is-in-a-object.md @@ -6,6 +6,7 @@ tip-number: 10 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: These are ways to check if a property is present in an object. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/en/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md b/_posts/en/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md index d488ea29..f5f96858 100644 --- a/_posts/en/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md +++ b/_posts/en/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md @@ -6,6 +6,7 @@ tip-number: 32 tip-username: loverajoel tip-username-profile: https://twitter.com/loverajoel tip-tldr: An Object it is an unordered collection of properties... that means that if you are trying to save ordered data inside an Object, you have to review it because properties order in objects are not guaranteed. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/en/2016-02-07-flattening-multidimensional-arrays-in-javascript.md b/_posts/en/2016-02-07-flattening-multidimensional-arrays-in-javascript.md index e0db4de0..93fb0bea 100644 --- a/_posts/en/2016-02-07-flattening-multidimensional-arrays-in-javascript.md +++ b/_posts/en/2016-02-07-flattening-multidimensional-arrays-in-javascript.md @@ -6,6 +6,7 @@ tip-number: 38 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: Three different solutions to merge multidimensional array into a single array. +tip-writer-support: https://www.coinbase.com/loverajoel categories: diff --git a/_posts/en/2016-02-14-calculate-the-max-min-value-from-an-array.md b/_posts/en/2016-02-14-calculate-the-max-min-value-from-an-array.md index f0920aca..edd0dd33 100644 --- a/_posts/en/2016-02-14-calculate-the-max-min-value-from-an-array.md +++ b/_posts/en/2016-02-14-calculate-the-max-min-value-from-an-array.md @@ -6,6 +6,7 @@ tip-number: 45 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: Ways to use the built-in functions Math.max() and Math.min() with arrays of numbers +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/en/2016-02-15-detect-document-ready-in-pure-js.md b/_posts/en/2016-02-15-detect-document-ready-in-pure-js.md index 2fb38647..7a8580bf 100644 --- a/_posts/en/2016-02-15-detect-document-ready-in-pure-js.md +++ b/_posts/en/2016-02-15-detect-document-ready-in-pure-js.md @@ -6,6 +6,7 @@ tip-number: 46 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: The cross-browser way to check if the document has loaded in pure JavaScript +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/en/2016-08-02-copy-to-clipboard.md b/_posts/en/2016-08-02-copy-to-clipboard.md index 0575da09..b3506528 100644 --- a/_posts/en/2016-08-02-copy-to-clipboard.md +++ b/_posts/en/2016-08-02-copy-to-clipboard.md @@ -6,6 +6,7 @@ tip-number: 56 tip-username: loverajoel tip-username-profile: https://twitter.com/loverajoel tip-tldr: This week I had to create a common "Copy to Clipboard" button, I've never created one before and I want to share how I made it. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - en diff --git a/_posts/es_ES/2015-12-29-insert-item-inside-an-array.md b/_posts/es_ES/2015-12-29-insert-item-inside-an-array.md index 2b235831..db456ee9 100644 --- a/_posts/es_ES/2015-12-29-insert-item-inside-an-array.md +++ b/_posts/es_ES/2015-12-29-insert-item-inside-an-array.md @@ -6,6 +6,7 @@ tip-number: 00 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: La inserción de un elemento en un array existente, es una tarea común diaria. Se pueden añadir elementos al final de un array mediante push, al principio usando unshift, al medio que usa splice. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/es_ES/2016-01-01-angularjs-digest-vs-apply.md b/_posts/es_ES/2016-01-01-angularjs-digest-vs-apply.md index a421f4f3..4b83febe 100644 --- a/_posts/es_ES/2016-01-01-angularjs-digest-vs-apply.md +++ b/_posts/es_ES/2016-01-01-angularjs-digest-vs-apply.md @@ -6,6 +6,7 @@ tip-number: 01 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: Los pasos para crear modulos en Javascript son cada vez más numerosos y complicados, pero ¿qué hay de los boilerplate en los nuevos frameworks? +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/es_ES/2016-01-02-keys-in-children-components-are-important.md b/_posts/es_ES/2016-01-02-keys-in-children-components-are-important.md index ff23a317..4c61181c 100644 --- a/_posts/es_ES/2016-01-02-keys-in-children-components-are-important.md +++ b/_posts/es_ES/2016-01-02-keys-in-children-components-are-important.md @@ -6,6 +6,7 @@ tip-number: 02 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: La key es un atributo que se debe pasar a todos los componentes creados dinámicamente a partir de un array. Es un identificador único y constante que React usa para identificar cada componente en el DOM y saber si se trata de un componente diferente o el mismo. Utilizando keys asegura que el componente secundario se conserve y no se cree nuevamente y evita que cosas extrañas sucedan. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/es_ES/2016-01-04-sorting-strings-with-accented-characters.md b/_posts/es_ES/2016-01-04-sorting-strings-with-accented-characters.md index 92e725ee..4c59d27c 100644 --- a/_posts/es_ES/2016-01-04-sorting-strings-with-accented-characters.md +++ b/_posts/es_ES/2016-01-04-sorting-strings-with-accented-characters.md @@ -6,6 +6,7 @@ tip-number: 04 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: Javascript tiene un método nativo **sort** que permite ordenar matrices. Haciendo un simple `array.sort()` va a tratar a cada entrada del array como una cadena y va a tratar de ordenarla alfabéticamente. Pero cuando intenta ordenar un array de caracteres no ASCII obtendrá un resultado extraño. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/es_ES/2016-01-05-differences-between-undefined-and-null.md b/_posts/es_ES/2016-01-05-differences-between-undefined-and-null.md index 01d13f1b..958b7f71 100644 --- a/_posts/es_ES/2016-01-05-differences-between-undefined-and-null.md +++ b/_posts/es_ES/2016-01-05-differences-between-undefined-and-null.md @@ -6,6 +6,7 @@ tip-number: 05 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: Comprendiendo las diferencias entre `undefined` y `null`. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/es_ES/2016-01-10-check-if-a-property-is-in-a-object.md b/_posts/es_ES/2016-01-10-check-if-a-property-is-in-a-object.md index 76d236de..f88d4ee5 100644 --- a/_posts/es_ES/2016-01-10-check-if-a-property-is-in-a-object.md +++ b/_posts/es_ES/2016-01-10-check-if-a-property-is-in-a-object.md @@ -6,6 +6,7 @@ tip-number: 10 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: Estas son formas de comprobar si una propiedad está presente en un objeto. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/es_ES/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md b/_posts/es_ES/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md index 35441e70..a9d0909b 100644 --- a/_posts/es_ES/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md +++ b/_posts/es_ES/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md @@ -6,6 +6,7 @@ tip-number: 32 tip-username: loverajoel tip-username-profile: https://twitter.com/loverajoel tip-tldr: Un objeto es una colección desordenada de propiedades... que significa que si está tratando de guardar los datos ordenados dentro de un objeto, hay que revisarlo debido a que las propiedades de orden en los objetos no están garantizados. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/es_ES/2016-02-07-flattening-multidimensional-arrays-in-javascript.md b/_posts/es_ES/2016-02-07-flattening-multidimensional-arrays-in-javascript.md index 06f4d1e4..a8b81ae6 100644 --- a/_posts/es_ES/2016-02-07-flattening-multidimensional-arrays-in-javascript.md +++ b/_posts/es_ES/2016-02-07-flattening-multidimensional-arrays-in-javascript.md @@ -6,6 +6,7 @@ tip-number: 38 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: Tres soluciones diferentes para combinar arrays multidimensional en un sola arrays. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/es_ES/2016-02-14-calculate-the-max-min-value-from-an-array.md b/_posts/es_ES/2016-02-14-calculate-the-max-min-value-from-an-array.md index b0933fc4..a51479bd 100644 --- a/_posts/es_ES/2016-02-14-calculate-the-max-min-value-from-an-array.md +++ b/_posts/es_ES/2016-02-14-calculate-the-max-min-value-from-an-array.md @@ -6,6 +6,7 @@ tip-number: 45 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: Formas de utilizar las funciones Math.max() y Math.min() con array de números +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/es_ES/2016-02-15-detect-document-ready-in-pure-js.md b/_posts/es_ES/2016-02-15-detect-document-ready-in-pure-js.md index f20e3d98..98a2273a 100644 --- a/_posts/es_ES/2016-02-15-detect-document-ready-in-pure-js.md +++ b/_posts/es_ES/2016-02-15-detect-document-ready-in-pure-js.md @@ -6,6 +6,7 @@ tip-number: 46 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: La forma cross-browser para comprobar si el DOM se ha cargado en JavaScript puro. +tip-writer-support: https://www.coinbase.com/loverajoel categories: - es_ES diff --git a/_posts/zh_CN/2015-12-29-insert-item-inside-an-array.md b/_posts/zh_CN/2015-12-29-insert-item-inside-an-array.md index 0edf1dc3..04fcf21b 100644 --- a/_posts/zh_CN/2015-12-29-insert-item-inside-an-array.md +++ b/_posts/zh_CN/2015-12-29-insert-item-inside-an-array.md @@ -6,7 +6,7 @@ tip-number: 00 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: 向一个数组中插入元素是平时很常见的一件事情。你可以使用push在数组尾部插入元素,可以用unshift在数组头部插入元素,也可以用splice在数组中间插入元素。 - +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_CN/2016-01-01-angularjs-digest-vs-apply.md b/_posts/zh_CN/2016-01-01-angularjs-digest-vs-apply.md index 96f98c02..32539a43 100644 --- a/_posts/zh_CN/2016-01-01-angularjs-digest-vs-apply.md +++ b/_posts/zh_CN/2016-01-01-angularjs-digest-vs-apply.md @@ -6,7 +6,7 @@ tip-number: 01 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: JavaScript模块和构建步骤越来越复杂和多样化,但是新框架里的样板是什么样子的呢? - +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_CN/2016-01-02-keys-in-children-components-are-important.md b/_posts/zh_CN/2016-01-02-keys-in-children-components-are-important.md index 5ffb37b8..868035b3 100644 --- a/_posts/zh_CN/2016-01-02-keys-in-children-components-are-important.md +++ b/_posts/zh_CN/2016-01-02-keys-in-children-components-are-important.md @@ -6,6 +6,7 @@ tip-number: 02 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: key是必须传递给从数组中动态创建的所有组件的一个值。它是一个唯一且固定的id,用来识别DOM中的每个组件,也可以让我们区别它是否是同一个组件。使用key可以确保子容器是可保存而且不需要重复创建的,还可以防止奇怪的事情发生。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_CN/2016-01-04-sorting-strings-with-accented-characters.md b/_posts/zh_CN/2016-01-04-sorting-strings-with-accented-characters.md index 80137dde..39e408a3 100644 --- a/_posts/zh_CN/2016-01-04-sorting-strings-with-accented-characters.md +++ b/_posts/zh_CN/2016-01-04-sorting-strings-with-accented-characters.md @@ -6,6 +6,7 @@ tip-number: 04 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: Javascript有一个原生方法**sort**可以排列数组。一次简单的`array.sort()`将每一个数组元素视为字符串并按照字母表排列。但是当你试图整理一个非ASCII元素的数组时,你可能会得到一个奇怪的结果。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_CN/2016-01-05-differences-between-undefined-and-null.md b/_posts/zh_CN/2016-01-05-differences-between-undefined-and-null.md index 09459f58..2eedde50 100644 --- a/_posts/zh_CN/2016-01-05-differences-between-undefined-and-null.md +++ b/_posts/zh_CN/2016-01-05-differences-between-undefined-and-null.md @@ -6,6 +6,7 @@ tip-number: 05 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: 理解`undefined`与`null`的区别。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_CN/2016-01-10-check-if-a-property-is-in-a-object.md b/_posts/zh_CN/2016-01-10-check-if-a-property-is-in-a-object.md index 0e128cc8..11e85804 100644 --- a/_posts/zh_CN/2016-01-10-check-if-a-property-is-in-a-object.md +++ b/_posts/zh_CN/2016-01-10-check-if-a-property-is-in-a-object.md @@ -6,6 +6,7 @@ tip-number: 10 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: 这是一些检查某对象是否有某属性的方法。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_CN/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md b/_posts/zh_CN/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md index a8ae7af1..615cde8a 100644 --- a/_posts/zh_CN/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md +++ b/_posts/zh_CN/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md @@ -6,6 +6,7 @@ tip-number: 32 tip-username: loverajoel tip-username-profile: https://twitter.com/loverajoel tip-tldr: 对象是一个无序的对象集合。这意味着如果你想在对象里保存有序的数据,你需要重新处理它,因为对象里的数据不保证是有序的。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_CN/2016-02-07-flattening-multidimensional-arrays-in-javascript.md b/_posts/zh_CN/2016-02-07-flattening-multidimensional-arrays-in-javascript.md index 162cb457..f9b0e5ef 100644 --- a/_posts/zh_CN/2016-02-07-flattening-multidimensional-arrays-in-javascript.md +++ b/_posts/zh_CN/2016-02-07-flattening-multidimensional-arrays-in-javascript.md @@ -6,6 +6,7 @@ tip-number: 38 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: 将多位数组转化为单一数组的三种不同方法。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: diff --git a/_posts/zh_CN/2016-02-14-calculate-the-max-min-value-from-an-array.md b/_posts/zh_CN/2016-02-14-calculate-the-max-min-value-from-an-array.md index 230a4c41..4db8813b 100644 --- a/_posts/zh_CN/2016-02-14-calculate-the-max-min-value-from-an-array.md +++ b/_posts/zh_CN/2016-02-14-calculate-the-max-min-value-from-an-array.md @@ -6,6 +6,7 @@ tip-number: 45 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: 对于纯数字数组,使用内置函数Math.max()和Math.min()的方法。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_CN/2016-02-15-detect-document-ready-in-pure-js.md b/_posts/zh_CN/2016-02-15-detect-document-ready-in-pure-js.md index 9478b36e..2f21e804 100644 --- a/_posts/zh_CN/2016-02-15-detect-document-ready-in-pure-js.md +++ b/_posts/zh_CN/2016-02-15-detect-document-ready-in-pure-js.md @@ -6,6 +6,7 @@ tip-number: 46 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: 跨浏览器且纯JavaScript检测document是否加载完成。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_CN/2016-08-02-copy-to-clipboard.md b/_posts/zh_CN/2016-08-02-copy-to-clipboard.md index 060e535c..3d955268 100644 --- a/_posts/zh_CN/2016-08-02-copy-to-clipboard.md +++ b/_posts/zh_CN/2016-08-02-copy-to-clipboard.md @@ -6,6 +6,7 @@ tip-number: 56 tip-username: loverajoel tip-username-profile: https://twitter.com/loverajoel tip-tldr: 本周我做了一个简单的“复制到剪贴板”按钮,这是我第一次做这种功能,向大家分享一下我的实现方法。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_CN diff --git a/_posts/zh_TW/2015-12-29-insert-item-inside-an-array.md b/_posts/zh_TW/2015-12-29-insert-item-inside-an-array.md index b9aba6f3..ad70562a 100644 --- a/_posts/zh_TW/2015-12-29-insert-item-inside-an-array.md +++ b/_posts/zh_TW/2015-12-29-insert-item-inside-an-array.md @@ -6,6 +6,7 @@ tip-number: 00 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: 在一個存在的陣列加入新的元素是一件很常見的事情,你可以使用 push 將元素加入到陣列的末端,或是使用 unshift 在陣列起始位置加入元素,也可以使用 splice 在陣列中間的地方加入元素。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: diff --git a/_posts/zh_TW/2016-01-01-angularjs-digest-vs-apply.md b/_posts/zh_TW/2016-01-01-angularjs-digest-vs-apply.md index c5188182..7472fd7b 100644 --- a/_posts/zh_TW/2016-01-01-angularjs-digest-vs-apply.md +++ b/_posts/zh_TW/2016-01-01-angularjs-digest-vs-apply.md @@ -6,6 +6,7 @@ tip-number: 01 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: JavaScript 模組以及建構步驟變得更多更複雜,但對於新的框架樣板呢? +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_TW diff --git a/_posts/zh_TW/2016-01-02-keys-in-children-components-are-important.md b/_posts/zh_TW/2016-01-02-keys-in-children-components-are-important.md index bc8ef7a5..991024d0 100644 --- a/_posts/zh_TW/2016-01-02-keys-in-children-components-are-important.md +++ b/_posts/zh_TW/2016-01-02-keys-in-children-components-are-important.md @@ -6,6 +6,7 @@ tip-number: 02 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: 你可以從陣列動態建立 key 屬性並傳送到所有的元件(component)。它是一個唯一以及固定的 id,React 用來識別 DOM 裡面的每個元件,並區別它是否為同一個元件。使用 keys 可以確保子元件被保護而不會被重覆建立,也可以防止奇怪的事件發生。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_TW diff --git a/_posts/zh_TW/2016-01-04-sorting-strings-with-accented-characters.md b/_posts/zh_TW/2016-01-04-sorting-strings-with-accented-characters.md index e044164a..39fb6249 100644 --- a/_posts/zh_TW/2016-01-04-sorting-strings-with-accented-characters.md +++ b/_posts/zh_TW/2016-01-04-sorting-strings-with-accented-characters.md @@ -6,6 +6,7 @@ tip-number: 04 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: JavaScript 原生的 **sort** 方法讓我們可以排序陣列。做一個簡單的 `array.sort()`, 將每一個陣列元素視為字串並依字母排序。但是當你嘗試排序一個非 ASCII 字元陣列時,你會得到一個奇怪的結果。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_TW diff --git a/_posts/zh_TW/2016-01-05-differences-between-undefined-and-null.md b/_posts/zh_TW/2016-01-05-differences-between-undefined-and-null.md index 940dcc12..104d62fa 100644 --- a/_posts/zh_TW/2016-01-05-differences-between-undefined-and-null.md +++ b/_posts/zh_TW/2016-01-05-differences-between-undefined-and-null.md @@ -6,6 +6,7 @@ tip-number: 05 tip-username: loverajoel tip-username-profile: https://github.com/loverajoel tip-tldr: 了解 `undefined` 和 `null` 的差別。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_TW diff --git a/_posts/zh_TW/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md b/_posts/zh_TW/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md index 773ba1b7..01223923 100644 --- a/_posts/zh_TW/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md +++ b/_posts/zh_TW/2016-02-01-map-to-the-rescue-adding-order-to-object-properties.md @@ -6,6 +6,7 @@ tip-number: 32 tip-username: loverajoel tip-username-profile: https://twitter.com/loverajoel tip-tldr: 物件是一個沒有排序的屬性集合...意思說,如果你想嘗試在你的物件儲存已排序的資料,你需要重新檢查,因為屬性在物件不保證是有排序的。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_TW diff --git a/_posts/zh_TW/2016-02-07-flattening-multidimensional-arrays-in-javascript.md b/_posts/zh_TW/2016-02-07-flattening-multidimensional-arrays-in-javascript.md index e2d1b1e8..590ec477 100644 --- a/_posts/zh_TW/2016-02-07-flattening-multidimensional-arrays-in-javascript.md +++ b/_posts/zh_TW/2016-02-07-flattening-multidimensional-arrays-in-javascript.md @@ -6,7 +6,7 @@ tip-number: 38 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: 三種不同的解決方法,將多維陣列合併為單一的陣列。 - +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_TW diff --git a/_posts/zh_TW/2016-02-14-calculate-the-max-min-value-from-an-array.md b/_posts/zh_TW/2016-02-14-calculate-the-max-min-value-from-an-array.md index 63ce9b16..c2ce7884 100644 --- a/_posts/zh_TW/2016-02-14-calculate-the-max-min-value-from-an-array.md +++ b/_posts/zh_TW/2016-02-14-calculate-the-max-min-value-from-an-array.md @@ -6,6 +6,7 @@ tip-number: 45 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: 在數字陣列使用內建的 Max.max() 和 Max.min() 函式的方式。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_TW diff --git a/_posts/zh_TW/2016-02-15-detect-document-ready-in-pure-js.md b/_posts/zh_TW/2016-02-15-detect-document-ready-in-pure-js.md index e7e7e486..5392214e 100644 --- a/_posts/zh_TW/2016-02-15-detect-document-ready-in-pure-js.md +++ b/_posts/zh_TW/2016-02-15-detect-document-ready-in-pure-js.md @@ -6,6 +6,7 @@ tip-number: 46 tip-username: loverajoel tip-username-profile: https://www.twitter.com/loverajoel tip-tldr: 可以跨瀏覽器,而且使用 pure JavaScript 來確認文件是否已經載入完成。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_TW diff --git a/_posts/zh_TW/2016-08-02-copy-to-clipboard.md b/_posts/zh_TW/2016-08-02-copy-to-clipboard.md index c3ffec75..3a174313 100644 --- a/_posts/zh_TW/2016-08-02-copy-to-clipboard.md +++ b/_posts/zh_TW/2016-08-02-copy-to-clipboard.md @@ -6,6 +6,7 @@ tip-number: 56 tip-username: loverajoel tip-username-profile: https://twitter.com/loverajoel tip-tldr: 本週我建立了一個常見的「複製到剪貼版」按鈕,我以前不曾做過這樣的功能,我想分享我如何實作它。 +tip-writer-support: https://www.coinbase.com/loverajoel categories: - zh_TW diff --git a/about.md b/about.md index a8b1277f..d2b5dd01 100644 --- a/about.md +++ b/about.md @@ -16,6 +16,9 @@ Please feel free to send us a PR with your own JavaScript tip to be published he Any improvements or suggestions are more than welcome! [Click to see the instructions](https://github.com/loverajoel/jstips/blob/master/CONTRIBUTING.md) +## Support the community +Well, if you like a tip or a writer, if you read in a specific language, you can support the writer and translator. Just send a tip and let them know the awesome work that they are doing! + ### Let’s keep in touch There are a lot of way to get update, choose your own diff --git a/style.scss b/style.scss index 6a92fc7f..c961e3d5 100644 --- a/style.scss +++ b/style.scss @@ -648,6 +648,10 @@ img { } } + a { + color: #000; + } + .share { color: $color-black; text-transform: uppercase; @@ -730,6 +734,32 @@ img { } } +.support-button { + font-size: 12px; + float: left; + border: 1px solid #000; + color: #000; + margin: 3px 0 0 0; + height: 30px; + + a { + color: #000; + padding: 5px; + float: left; + + img { + width: 15px; + height: 15px; + float: left; + margin: 1px 3px 0 0; + } + } +} + +.support-button:hover { + background: #e1b90a; +} + .email-suscribe { width: 100%; position: relative;