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 / .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 / 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 / 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);
});
/*
@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
[{
"keys": [
"ctrl+shift+z"
],
"command": "expand_as_you_type",
"context": [
{
"operand": false,
"operator": "equal",
"match_all": true,
@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/
/*
|--------------------------------------------------------------------------
| 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 / .bashrc file
Created November 18, 2013 00:53
My .bashrc file (Linux)
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
alias pa="php artisan"
alias tsp="cd /var/www/html/tsp/theservicepro.net"
@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
@elena-kolevska
elena-kolevska / all.yawl.settings
Created December 5, 2013 14:21
Yawl gnome extension settings
[addons>attention]
icons-attention-blink b +
icons-attention-blink-rate s 39
[addons>preview]
windows-preview b -
windows-preview-dim-color s #01234c
windows-preview-dim-opacity s 25
windows-preview-panel-opacity s 25