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 |
// | |
// Copyright 2017 Johannes Müller <straightshoota@gmail.com> | |
// | |
// 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 |
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 |
; ModuleID = 'main_module' | |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-pc-linux-gnu" | |
%String = type { i32, i32, i32, i8 } | |
%"Slice(UInt8)" = type { i32, i1, i8* } | |
%"Array(String)" = type { i32, i32, i32, %String** } | |
%"->" = type { i8*, i8* } | |
%"Array(Pointer(Void))" = type { i32, i32, i32, i8** } | |
%Fiber = type { i32, i8*, %"(Event::Event | Nil)", i8*, i8*, %Fiber*, %Fiber*, %String*, %"(Proc(Nil) | Proc(Void))" } |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
clone_crystal_from_vagrant = lambda do |config| | |
config.vm.provision :shell, privileged: false, inline: %( | |
# Checkout crystal repository | |
git clone /vagrant crystal | |
) | |
end |
#!/bin/sh | |
# | |
# This script ensures Crystal code is correctly formatted before committing it. | |
# It won't apply any format changes automatically. | |
# | |
# Only staged files (the ones to be committed) are being processed, but each file is checked | |
# entirely as it is stored on disc, even parts that are not staged. | |
# | |
# To use this script, it needs to be installed in the local git repository. For example by running | |
# curl https://gist.githubusercontent.com/straight-shoota/fdaf4cf1954e084cd5abccf8f77975f6/raw/pre-commit > .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit |