Skip to content

Instantly share code, notes, and snippets.

@ro31337
ro31337 / howto.md
Last active April 13, 2020 17:52
How to translate LibreTaxi 2.0 into your language

LibreTaxi 2.0 is almost here.

It will automatically switch the language depending on your current language code. How do you set your language code? Well, it's set automatically by Telegram. I think when you change the interface language in Telegram, it changes the language in LibreTaxi. Sometimes you need a couple of minutes for changes to take effect.

So now technical details if you want to translate it from the very beginning. Look at this text:

https://github.com/ro31337/libretaxi/blob/master/locales/all/en.po

@ro31337
ro31337 / gist:fde256c19074356e4f847a48f696658c
Last active October 15, 2023 16:59
Bulma font-awesome icons for Rails 6

Единственная запара возникла при подключении иконок к рельс6, решается так (app/javascript/packs/fa.scss)

@import "bulma/bulma";

$fa-font-path: '~@fortawesome/fontawesome-free/webfonts';
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/solid'; // fas prefix
@import '~@fortawesome/fontawesome-free/scss/brands'; // fab prefix
// see https://fontawesome.com/how-to-use/with-the-api/setup/importing-icons for more prefixes
@ro31337
ro31337 / rabbitmq.md
Last active April 12, 2023 08:51
Easiest RabbitMQ setup

Install RabbitMQ:

docker run -d --hostname my-rabbit --name blabla-rabbit -p 5672:5672 -p 8080:15672 rabbitmq:3-management

RabbitMQ works based on hostname:

One of the important things to note about RabbitMQ is that it stores data based on what it calls the "Node Name", which defaults to the hostname

@ro31337
ro31337 / instacart.md
Last active December 5, 2018 16:56
InstaCart tech phone screen challenge

Challenge 1

Implement simple key-value storage (KV class), like:

kv = KV.new
kv.set('foo', 'bar')
kv.get('foo') # => returns "bar"
@ro31337
ro31337 / objects.md
Last active October 22, 2018 23:02
Create new object in JavaScript, Object.assign vs destructuring

Define state:

> state = { aa: 11, bb: 22 }
{ aa: 11, bb: 22 }

First way, create new object with Object.assign:

@ro31337
ro31337 / app.rb
Created October 1, 2018 01:26
Игра в грин-карту, поиск счастливой секунды
# Внимание! Перед запуском программы:
# - отключите все соц.сети, мессенджеры, чтобы случайно не нажать.
# - поставьте magic в 3 и _перейдите в ваш браузер_ (!), чтобы программа
# работала в фоне. Посмотрите как ваш терминал уведомит вас. Может
# появиться одинарный звук и всплывающее уведомление. Зависит от
# операционной системы и терминала. Вы должны точно знать как выглядит
# или звучит уведомление, чтобы нажать в правильный момент.
# главная переменная программы, чем больше, тем лучше.
magic = 9
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : 0.3529411764705883,
"Blue Component" : 0.9529411764705882,
"Red Component" : 0.1843137254901961
},
#!/bin/bash
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
#
# ZeroTier install script
#
# All this script does is determine your OS and/or distribution and then add the correct
# repository or download the correct package and install it. It then starts the service
# and prints your device's ZeroTier address.
#
@ro31337
ro31337 / ruby-it-on-file-change.sh
Last active May 20, 2018 22:26
Run "ruby" over file when file changes (useful for vim + tmux panes, or other tiled window setup. Make sure you +x this script)
#!/bin/bash
#
# Usage: ./ruby-it-on-file-change.sh app.rb
# ^ Will automatically run "ruby app.rb" when file changes
#
echo "Watching for changes in $1, save this file to run \"ruby $1\""
if uname | grep -q "Darwin"; then
mod_time_fmt="-f %m"
else
@ro31337
ro31337 / README.md
Created April 30, 2018 03:49
MariaDB (MySQL) through Docker

MariaDB (MySQL).

Docker is the easiest way to have MariaDB running.

Create volume so your storage will be preserved (argument to -v parameter below):

docker volume create mariadb

Run MariaDB container: