This file contains 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
import Kernel, except: [length: 1] | |
defmodule String do | |
@moduledoc ~S""" | |
A String in Elixir is a UTF-8 encoded binary. | |
## Codepoints and graphemes | |
The functions in this module act according to the Unicode | |
Standard, version 6.3.0. As per the standard, a codepoint is |
This file contains 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
import Kernel, except: [length: 1] | |
defmodule String do | |
@moduledoc ~S""" | |
A String in Elixir is a UTF-8 encoded binary. | |
## Codepoints and graphemes | |
The functions in this module act according to the Unicode | |
Standard, version 6.3.0. As per the standard, a codepoint is |
This file contains 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
- title: Getting Started | |
dir: /getting_started/ | |
pages: | |
- title: Introduction | |
slug: introduction | |
- title: Basic types | |
slug: basic_types | |
- title: Basic operators |
This file contains 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
1) **Fork and Clone this Repository** | |
[Fork this repository](https://github.com/elixir-lang/elixir-lang.github.com/fork), and Create a local clone of your fork. You may want to read the [Instructions on how to do that](https://help.github.com/articles/fork-a-repo/). | |
2) **Install [Ruby](https://www.ruby-lang.org/)** | |
To setup a development enviroment locally, you need to have Ruby installed. If you are running a Mac, it's probably installed. Run in your shell `ruby --version`. Your Ruby version should begin with `1.9.3` or `2.0.0`. You can follow [this guide](https://www.ruby-lang.org/en/documentation/installation/) if you need to install it. | |
3) **Install [Bundler](http://bundler.io/)** | |
```bash | |
gem install bundler | |
``` |
This file contains 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
get_number = fn (text) -> | |
case Regex.run(~r/\w (\d+)/, text) do | |
[_, number] -> number | |
_ -> nil | |
end | |
end | |
"10" = _number = get_number.("a 10") | |
nil = _number = get_number.("a NO") |
This file contains 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
defmacro is_regex(term) do | |
quote do | |
is_tuple(unquote(Macro.escape term)) and ( | |
(elem(unquote(Macro.escape term), 0) in [:sigil_r, :sigil_R, :r, :R]) or | |
(elem( elem(unquote(Macro.escape term), 2), 0 ) == {:__struct__, Regex}) | |
) | |
end | |
end |
This file contains 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
#Position Matches Frequency Top_% Word | |
610 50724 7096 59.23 hab | |
1367 24231 14855 66.39 cápita | |
1618 20900 17223 67.96 von | |
1667 20374 17667 68.25 msnm | |
2692 12581 28611 72.77 du | |
2863 11774 30572 73.35 br | |
3334 10164 35414 74.78 tribus | |
3484 9748 36926 75.19 desambiguación | |
3588 9436 38147 75.47 der |
This file contains 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
#!/bin/bash | |
# ./check_not_linked_exdoc.sh – http://git.io/check_not_linked_exdoc.sh | |
# | |
# Description: | |
# Check for references to exiting modules in the documentation, that is actually not being liked | |
# by ExDoc. | |
# | |
# Instructions | |
# Run from the root folder in the elixir project – https://github.com/elixir-lang/elixir/ |
This file contains 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
####################################################################### | |
# `ag` list file with first match line number | |
# Returns a list of files including the first line matched in the file | |
# emulates the non-implemented option: `ag --files-with-matches-line-number` | |
# for `ag` (the silver searcher) https://github.com/ggreer/the_silver_searcher | |
# feature request: https://github.com/ggreer/the_silver_searcher/issues/715 | |
# Usage: just simple use it as you would use `ag -l`, but ommit the -l option | |
# $ ag-l1 "(pattern)?.*" | |
# Installation: add this function to your ~/.bash_funcs file | |
# Download: https://git.io/ag-l1 |
This file contains 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
defmodule Kernel do | |
@doc """ | |
Converts any expression to boolean. | |
Returns `true` if `expr` is truthy (ie. it does not evaluate to `nil`, nor `false`), | |
otherwise returns the `false`. | |
Allowed in guard tests. | |
""" | |
@spec to_boolean(Macro.t) :: boolean |
OlderNewer