Skip to content

Instantly share code, notes, and snippets.

View czende's full-sized avatar
🎯
Focusing

Jan Czernin czende

🎯
Focusing
View GitHub Profile
@czende
czende / docker-compose.yaml
Created September 11, 2019 22:10
GitLab with runner via docker-compose
version: '3.7'
services:
gitlab-web:
image: gitlab/gitlab-ce:latest
container_name: gitlab-web
hostname: gitlab-web
volumes:
- './gitlab-config:/etc/gitlab'
- './gitlab-logs:/var/log/gitlab'
@czende
czende / check.sh
Last active September 11, 2019 22:12
Check version by git tag in pipeline
#!/bin/sh
APP_VERSION="$(git tag --contains $BITBUCKET_COMMIT)"
ENVIRONMENT="$1"
STG_REGEX="^v.*\\-.*$"
PROD_REGEX="^v.[^-]*$"
# Check commit tag
if [ "$APP_VERSION" == "" ] ; then
echo "ERROR: Commit doesn't contain TAG!";
@czende
czende / slugify.php
Last active September 11, 2019 22:12
Slug generator
/**
* Slug generator
*/
function slugify($str, $options = array()) {
// Make sure string is in UTF-8 and strip invalid UTF-8 characters
$str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());
$defaults = array(
'delimiter' => '-',
'limit' => null,
@czende
czende / gist:6919c48850a8784f78f69106234fdf58
Created May 17, 2017 13:28 — forked from clintongormley/gist:4095280
Using synonyms in Elasticsearch

We create an index with:

  • two filters: synonyms_expand and synonyms_contract
  • two analyzers: synonyms_expand and synonyms_contract
  • three text fields:
    • text_1 uses the synonyms_expand analyzer at index and search time
    • text_2 uses the synonyms_expand analyzer at index time, but the standard analyzer at search time
    • text_3 uses the synonyms_contract analyzer at index and search time

.