i18n_backend_database
Database Backend for Rails I18n
i18n_db_admin
Demo application including admin interface for Rails translations using i18n_db
i18n_backend_database
Database Backend for Rails I18n
i18n_db_admin
Demo application including admin interface for Rails translations using i18n_db
# exports data from http://bistum-fulda.de/bistum_fulda/bistum/pfarreien/pfarreiliste/pfarreienbistumfulda.php?navid=708113708113 | |
(String.prototype.strip = -> @replace(/^\s+|\s+$/g, "")) unless typeof "".strip == "function" | |
data = (for row in $('.pfarreilistdata tr[class]') | |
continue if Number.isNaN(i) | |
try | |
url = row.children[2].querySelector('a.pfarreiurl') | |
mail = row.children[2].querySelector('a[href]:not(.pfarreiurl)') | |
name: row.children[0].childNodes[0].innerText.strip() |
(String.prototype.strip = -> @replace(/^\s+|\s+$/g, "")) unless typeof "".strip == "function" | |
data = [] | |
#document.querySelectorAll('.full_view_standard a.alphabet') | |
single_urls = ["http://www.bistum-augsburg.de/index.php/bistum/Pfarreien/Maria-Schnee-_Aach"] | |
for url in single_urls |
This task cleans sites-enabled dir from config files that should not be enabled anymore
Its quite easy to use a list of enabled sites
to link their config files to sites-enabled, as shown in the last entry.
There will still be links to the config files of sites that had been enabled in the previous ansible run, they need to be removed explicitly.
The simple way would be to remove the sites-enablied directory alltogether. But this would allways require
to create new links to the config files for enabled sites. Thus it would force a server restart even if there had really no changes at all. Defining a var disabled_sites
is not quite a good idea since you would probably forget to add or remove items from that list at one time.
So my solution is to list all config files that do not correspond to enabled sites and in a second step remove those.
I use it with nginx, but it should also work with apache/httpd or other configurations with a similar concept.
It would be easier to use just rm
with an extended gl
// | |
// Copyright 2017 Johannes Müller <[email protected]> | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software |
macro memoize(type_decl, &block) | |
@{{type_decl.var}} : {{ type_decl.type }} | UninitializedMemo = UninitializedMemo::INSTANCE | |
def {{type_decl.var}} | |
if (value = @{{type_decl.var}}).is_a?(UninitializedMemo) | |
@{{type_decl.var}} = begin | |
{{block.body}} | |
end | |
else | |
value |
struct Date | |
include Comparable(self) | |
getter year : Int32 | |
getter month : Int16 | |
getter day : Int16 | |
def initialize(year, month, day) | |
Calendar.validate!(year, month, day) |
check every key 3.0 (333.07ms) (±21.04%) 20.38× slower | |
trie lookup 33.95 ( 29.46ms) (±11.63%) 1.80× slower | |
hash 61.19 ( 16.34ms) (±17.27%) fastest |
data: ngrams.tsv | |
ngrams.tsv: | |
curl https://storage.googleapis.com/books/ngrams/books/googlebooks-eng-all-1gram-20120701-0.gz | gunzip > ngrams.tsv | |
benchmark: data | |
crystal cli_bench.cr --release --no-debug -- ngrams.tsv 1 2 | |
build: bin/crystal_nuts bin/crystal_int bin/crystal_array_with_backup bin/crystal_bench |
#!/usr/bin/env bash | |
# MSVC 2017 | |
# MSVC_BUILD_TOOLS="C:\\Program^ Files^ ^(x86^)\\Microsoft^ Visual^ Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat" | |
# MSVC 2015 | |
MSVC_BUILD_TOOLS="C:\\Program^ Files^ ^(x86^)\\Microsoft^ Visual^ C++^ Build^ Tools\\vcbuildtools.bat" | |
set -euo pipefail |