Skip to content

Instantly share code, notes, and snippets.

View bultas's full-sized avatar

Daniel Bultas bultas

View GitHub Profile
@bultas
bultas / linux-setup.sh
Created April 26, 2024 21:08 — forked from dhh/linux-setup.sh
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils

Sentence Transformer Benchmark

Mix.install([
  {:bumblebee, github: "elixir-nx/bumblebee", ref: "23de64b1b88ed3aad266025c207f255312b80ba6"},
  {:nx, github: "elixir-nx/nx", sparse: "nx", override: true},
  {:exla, github: "elixir-nx/nx", sparse: "exla", override: true},
  {:axon, "~> 0.5.1"},
[
{
"id": 1,
"title": "ACTIVATE YOU BRD online",
"content": "Download the app on your phone and register online."
},
{
"id": 2,
"title": "INSTANT PAYMENTS AS FAST AS YOU",
"content": "Day or night, any transfer reaches an account instantly, between participating banks in the interbank payment system. Main benefits: you can transfer amounts smaller than 50,000 Lei the payment will be processed in maximum 20 seconds no differential commission you benefit from the service as an individual"
@bultas
bultas / frontmatter.ex
Created February 26, 2023 13:24 — forked from dsignr/frontmatter.ex
Parse frontmatter in Elixir
def extract(changeset) do
file_name = changeset.data.name
data = File.read!("#{@data_folder}/pages/#{file_name}")
case String.split(data, ~r/\n-{3,}\n/, parts: 2) do
[""] ->
%{frontmatter: nil, content: nil}
[frontmatter, content] ->
%{
frontmatter: parse_yaml(frontmatter),
content: content
# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API.
#
# This is used for generating API documentation and the types used by the
# client/server. See api/README.md for more information.
#
# Some style notes:
# - This file is used by ReDoc, which allows GitHub Flavored Markdown in
# descriptions.
# - There is no maximum line length, for ease of editing and pretty diffs.
# - operationIds are in the format "NounVerb", with a singular noun.
Afrikaans af
Albanian sq
Arabic (Algeria) ar-dz
Arabic (Bahrain) ar-bh
Arabic (Egypt) ar-eg
Arabic (Iraq) ar-iq
Arabic (Jordan) ar-jo
Arabic (Kuwait) ar-kw
Arabic (Lebanon) ar-lb
Arabic (Libya) ar-ly
@bultas
bultas / heroku-remote.md
Created July 1, 2020 13:03 — forked from randallreedjr/heroku-remote.md
Add a Heroku remote to an existing git repo

Working with git remotes on Heroku

Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.

Adding a new remote

Add a remote for your Staging app and deploy

Note that on Heroku, you must always use master as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch seen below (in this example, we push the local staging branch to the master branch on heroku.

$ git remote add staging https://git.heroku.com/staging-app.git
@bultas
bultas / patternMatch.js
Created June 10, 2020 11:31
Pattern Match in javascript
import { cond, always, T, whereEq } from "ramda";
export const getProductPrice = cond([
[
whereEq({
type: "product1",
currency: "czk",
}),
({ price }) => `${price} Kc`,
],
@bultas
bultas / machine.js
Last active May 28, 2020 22:05
Generated by XState Viz: https://xstate.js.org/viz
const persooMachine = Machine({
id: "persoo",
initial: "initialize",
states: {
initialize: {
type: "parallel",
states: {
waitForPersooJS: {
initial: "fetching",
states: {
@bultas
bultas / getMaxZIndex.js
Created May 13, 2020 14:57
Get max zIndex in NodeList (document)
function convertToNumber(value) {
const asNumber = parseFloat(value);
return Number.isNaN(asNumber) ? 0 : asNumber;
}
function getNodeZIndex(node) {
const computedIndex = convertToNumber(window.getComputedStyle(node).zIndex);
const styleIndex = convertToNumber(node.style.zIndex);
if (computedIndex > styleIndex) {