Skip to content

Instantly share code, notes, and snippets.

View crivotz's full-sized avatar
🏠
Working from home

Mauro Locatelli crivotz

🏠
Working from home
View GitHub Profile
@crivotz
crivotz / chosen-bootstrap-5.css
Created March 31, 2023 07:54
Chosen-js bootstrap 5.3 working with theme
.chosen-select,
.chosen-select-deselect {
width: 100%;
}
.chosen-container {
display: inline-block;
position: relative;
width: 100% !important;
font-size: 1rem;
text-align: left;
@crivotz
crivotz / zhistory_merge.sh
Last active May 31, 2023 13:10
ZSH history merge
builtin fc -R -I .zhistory
builtin fc -R -I other_zhistory
# write the loaded history to HISTFILE
builtin fc -W "$HISTFILE"
@crivotz
crivotz / firebird25.md
Last active February 4, 2022 14:53
Firebird 2.5.9 installation on Debian 11 Bullseye

General notes

Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Firebird version: 2.5.9

For Linux, Superserver download packages start with FirebirdSS, Classic/SuperClassic packages with FirebirdCS. The default run mode for Classic/SuperClassic installations is traditional, multiprocess Classic. To switch to SuperClassic, run the script changeMultiConnectMode.sh and answer “thread” at the prompt (for multithreaded). The script is located in the bin subdirectory of your Firebird installation.

@crivotz
crivotz / dropbox_uninstall.sh
Created December 29, 2021 11:08
Dropbox headless uninstall
dropbox stop
dropbox status # Should report "not running"
rm -rf ~/.dropbox-dist
rm -rf /var/lib/dropbox
rm -rf ~/.dropbox*
sudo apt-get remove nautilus-dropbox
sudo apt-get remove dropbox
rm /etc/apt/source.d/dropbox
@crivotz
crivotz / rails_update.md
Created June 18, 2021 08:31
Rails update

Rails update Verifica possibili aggiornamenti

bundle outdated

Aggiornare versione in gemfile

bundle update rails
rails app:update
@crivotz
crivotz / fetch.js
Created April 3, 2020 12:52
Fetch example
async function init() {
try {
let login = await fetch('http://xxx.xxx.xxx.xxx/api/login', {
method: 'POST',
body: JSON.stringify({login: 'user', password: 'password'}),
}).then(response => response.json());
let action = await fetch('http://xxx.xxx.xxx.xxx/api/action', {
method: 'GET',
headers: {'Authorization': login.token},
}).then(response => response.json());
@crivotz
crivotz / git.sh
Created March 25, 2020 13:43
Compile git
sudo apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip
cd git
make prefix=/usr/local all
sudo make prefix=/usr/local install
@crivotz
crivotz / i3-gaps.md
Last active December 18, 2020 08:31
i3-gaps install/update

Debian dependencies

sudo apt-get install gcc make dh-autoreconf libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev xcb libxcb1-dev libxcb-icccm4-dev libyajl-dev libev-dev libxcb-xkb-dev libxcb-cursor-dev libxkbcommon-dev libxcb-xinerama0-dev libxkbcommon-x11-dev libstartup-notification0-dev libxcb-randr0-dev libxcb-xrm0 libxcb-xrm-dev libxcb-shape0 libxcb-shape0-dev
cd /usr/local/src

Clone the repository

git clone https://www.github.com/Airblader/i3 i3-gaps

@crivotz
crivotz / redis.md
Last active July 29, 2019 10:57
Redis installation on Debian Stretch
sudo apt-get install redis-server
sudo systemctl enable redis-server.service
sudo vim /etc/redis/redis.conf

set

maxmemory 256mb
maxmemory-policy allkeys-lru
<% @post.uploads.each do |upload| %>
<% if upload.variable? %>
<%= link_to image_tag(upload.variant(resize: "400x400")), upload %>
<% elsif upload.previewable? %>
<%= link_to image_tag(upload.preview(resize: "400x400")), rails_blob_path(upload, disposition: :attachment) %>
<% elsif upload.image? %>
<%= link_to image_tag(upload, width: 400), upload %>
<% else %>
<%= link_to upload.filename, rails_blob_path(upload, disposition: :attachment) %>
<% end %>