Skip to content

Instantly share code, notes, and snippets.

View elena-kolevska's full-sized avatar

Elena Kolevska elena-kolevska

View GitHub Profile
@elena-kolevska
elena-kolevska / main.go
Last active September 12, 2023 10:34
Get embeddings from Hugging face, save them in Redis and run a vector similarity search
// Run this gist with Redis Stack 6.2
// Tested with:
// docker run -p 6381:6379 redis/redis-stack-server:6.2.6-v9-arm64
package main
import (
"bytes"
"context"
"encoding/binary"
@elena-kolevska
elena-kolevska / memtier_start.sh
Last active December 23, 2019 12:41
Small cli tool for setting up parameters of the memtier_benchmark tool
#!/usr/bin/env bash
# Colours definition
HIGHLIGHT1='\033[0;34m'
HIGHLIGHT2='\033[0;33m'
SUCCESS='\033[0;32m'
ERROR='\033[0;31m'
GRAY='\033[0;37m'
NC='\033[0m' # No Color
@elena-kolevska
elena-kolevska / .zshrc
Last active September 26, 2023 23:47
My powerlevel9k theme config
# elena.zsh-theme
#
# Author: Elena Kolevska
# Based on Andy Flemin's afmagic theme
# dashed separator size
function afmagic_dashes {
# check either virtualenv or condaenv variables
local python_env_dir="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
local python_env="${python_env_dir##*/}"
@elena-kolevska
elena-kolevska / .bashrc
Last active October 16, 2018 14:21
Coloured prompt
#...
PS1="\[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\] \[\e[33m\]\w\[\e[m\] \[\e[33m\]\\$\[\e[m\] "
#...
# Online prompt generator: http://ezprompt.net/
@elena-kolevska
elena-kolevska / 20-xdebug.ini
Created December 17, 2015 12:07
Xdebug configuration. Homestead/Ubuntu.
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
$filters = array_reduce($filters_array, function ($result, $item) {
$result[$filters_array['id']] = $filters_array;
return $result;
}, array());
[{
"keys": [
"ctrl+shift+z"
],
"command": "expand_as_you_type",
"context": [
{
"operand": false,
"operator": "equal",
"match_all": true,
@elena-kolevska
elena-kolevska / validators.php
Last active June 24, 2021 14:44
Custom alphabetic validator that allows spaces
<?php
/* app/validators.php */
Validator::extend('alpha_spaces', function($attribute, $value)
{
return preg_match('/^[\pL\s]+$/u', $value);
});
/*
/*
|--------------------------------------------------------------------------
| Delete form macro
|--------------------------------------------------------------------------
|
| This macro creates a form with only a submit button.
| We'll use it to generate forms that will post to a certain url with the DELETE method,
| following REST principles.
|
*/
@elena-kolevska
elena-kolevska / .zshrc
Created December 29, 2013 16:40
My .zshrc file
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
# Example aliases