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
# Nginx optimal congifuration guide. | |
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.2.tar.gz | |
$ tar xzvf ./nginx-1.2.2.tar.gz && rm -f ./nginx-1.2.2.tar.gz | |
$ wget http://zlib.net/zlib127.zip |
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 InsensitiveString do | |
@moduledoc """ | |
Case insensitive string functions for | |
ASCII string | |
""" | |
@doc """ | |
Compare two ascii strings in a case insensitive | |
manner |
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 Treewalk do | |
@type tree :: {:node, integer(), tree(), tree()} | nil | |
def depth({:node, value, nil, nil}, _fun) do | |
value | |
end | |
def depth({:node, value, nil, right}, fun) do | |
fun.(value, depth(right, fun), nil) | |
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
defmodule PigLatin do | |
# vowels: a, e, i, o, u, y_, x_ | |
@vowels ["a", "e", "i", "o", "u"] | |
# special constants: "ch", "qu", "squ", "th", "thr", "sch" | |
@special ["ch", "qu", "squ", "thr", "th", "sch"] | |
@ay "ay" | |
defguard is_vowel(c) when c in @vowels |
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 ParseHelpers do | |
import NimbleParsec | |
def whitespace() do | |
ascii_char([?\s]) | |
|> repeat | |
end | |
def quote_mark(combinator \\ empty()) do | |
combinator |
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 Extract do | |
@moduledoc """ | |
Split into words only when the words have a "%" as a prefix | |
or a suffix | |
""" | |
# Empty string returns empty list | |
def words("") do | |
[] |
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 Channel do | |
@input [{0, 190}, {1, 0}, {2, 0}, {3, 0}, {6, 220}, {9, 90}] | |
@doc """ | |
Map a list of {index, value} pairs | |
into a binary, filling in any gaps in | |
the index sequence with <<0>> as | |
the list is built. | |
""" |
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
>> org.unicode.cldr.tool.GenerateProductionData | |
[-s, /Users/kip/Development/cldr_repo/common, -d, /Users/kip/Development/cldr_staging_data/common] | |
#-s sourceDirectory ≔ /Users/kip/Development/cldr_repo/common | |
#-d destinationDirectory ≔ /Users/kip/Development/cldr_staging_data/common | |
#-l logicalGroups ≝ true | |
#-t time ≝ true | |
#-S Sideways ≝ true | |
#-r root ≝ true | |
#-c constrainedRestoration ≝ true | |
#-i includeComprehensive ≝ true |
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 Distance do | |
@moduledoc """ | |
Ensure that you have the following in your mix.exs | |
file: | |
def deps do | |
{:libgraph, "~> 0.13"} | |
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
defmodule StringIndex do | |
@newline 10 | |
@doc """ | |
Returns a map of line numbers to | |
a 2-tuple that is the index at which | |
the line starts in `string` and the | |
length of the line. | |
### Example |
OlderNewer