Skip to content

Instantly share code, notes, and snippets.

@ebeigarts
ebeigarts / Latvian_fixed.keylayout
Last active March 14, 2024 14:48
Better latvian keyboard layout for OS X
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!-- Fri, 24 Feb 2006 Generated from KCHR: "Latvian" -->
<!--Last edited by Ukelele version 1.8b6 on 2008-04-23 at 22:32 (EEST)-->
<!--Created by Ukelele version 1.8b6 on 2008-04-23 at 21:59 (EEST)-->
<keyboard group="29" id="30765" name="Latvian fixed" maxout="1">
<layouts>
<layout first="0" last="0" modifiers="commonModifiers" mapSet="ANSI"/>
</layouts>
<modifierMap id="commonModifiers" defaultIndex="8">
#!/bin/bash
set -ex
rsvg-convert $1 -z 4 -o /tmp/temp.png
~/Downloads/vtracer-mac-arm64 -c 32 --mode spline --preset poster \
--input /tmp/temp.png \
--output /tmp/temp.svg
@ebeigarts
ebeigarts / mikrotik-chateau-cell-lock.txt
Created August 28, 2021 18:00 — forked from mrskug/mikrotik-chateau-cell-lock.txt
Mikrotik Chateau LTE cell lock described. Saved for posterity, in case forum post gets deleted.
https://forums.quectel.com/t/eg12-and-freq-or-cell-lock-feature/4619
thanks.
After many test I discover all stuff.
This is example at RouterBoard Chateau, RouterOS 7 beta 8
Quectel EG12 not support frequency lock to select band at any tower.
Quectel EG12 support one and many Cell Lock’s, you can enter max 20 of CellLock’s and it select the one with the best signal and set it as primary-band.
@ebeigarts
ebeigarts / nginx.conf
Created April 24, 2012 07:05
Mobile detection - iOS, other mobile platforms and desktop
daemon off;
error_log log/error.log crit;
events {
}
http {
uwsgi_temp_path tmp/;
scgi_temp_path tmp/;
proxy_temp_path tmp/;
@ebeigarts
ebeigarts / gist:970898
Created May 13, 2011 17:04
html2haml recursive
for f in `find . -regex '.*\.html\.erb'`; do echo "Converting $f" && html2haml $f > "${f%.erb}.haml" && rm $f; done
@ebeigarts
ebeigarts / gist:3159994
Last active February 15, 2023 07:05
Icons

729 icons, free, webfont, grayscale

200 icons, free

400 icons, $25

@ebeigarts
ebeigarts / RAILS_RELATIVE_URL_ROOT.md
Last active February 2, 2023 15:16
RAILS_RELATIVE_URL_ROOT

RAILS_RELATIVE_URL_ROOT

Rails

By default RAILS_RELATIVE_URL_ROOT is used only for asset pipeline.

To namespace your rails routes you need to wrap run MyApp::Application with map in your config.ru:

map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do
#!/usr/bin/env ruby
#
# Backup
#
# For more information:
#
# View the Git repository at https://github.com/meskyanichi/backup
# View the Wiki/Documentation at https://github.com/meskyanichi/backup/wiki
# View the issue log at https://github.com/meskyanichi/backup/issues
#
@ebeigarts
ebeigarts / README.md
Last active September 14, 2017 22:46
Dokku redeploy fix

Rebuild dokku nginx configuration with correct container IP addresses after system reboot until #2736 is released.

sudo curl -L -o /etc/systemd/system/dokku-redeploy-fix.service https://gist.github.com/ebeigarts/e3256021986f625acec62d9add04dfc3/raw/d85afd4e8beba843e273f4c8b7237c375a7eabea/dokku-redeploy-fix.service &&
sudo curl -L -o /usr/bin/dokku-redeploy-fix https://gist.github.com/ebeigarts/e3256021986f625acec62d9add04dfc3/raw/b4b3be7f3fdf51ba4e7716ac8cf04f40b97a762b/dokku-redeploy-fix.sh &&
sudo chmod +x /usr/bin/dokku-redeploy-fix &&
sudo systemctl enable dokku-redeploy-fix
#!/bin/bash
send-message() {
local message=$(echo "$@" \
| sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" \
| sed 's/\\/\\\\/g' \
| sed 's/"/\\"/g' \
| sed "s/'/\\'/g")
echo $message
json="{ \"text\": \"$message\" }"