Skip to content

Instantly share code, notes, and snippets.

@Paprikas
Paprikas / tailswindcss_3.0_chatgpt_openai_prompt.md
Created September 16, 2023 09:41
Use this prompt if you want to write some html + tailwind with latest tailwind version.

Tailwind CSS 3.0 was released. Whenever I ask to write some Tailwind CSS, you must use 3.0 version changes:

  1. Transform and filter utilities like scale-50 and brightness-75 will automatically take effect without needing to add the transform, filter, or backdrop-filter classes.

    • Before: <div class="transform scale-50 filter grayscale backdrop-filter backdrop-blur-sm">
    • After: <div class="scale-50 grayscale backdrop-blur-sm">
  2. The new engine introduces a new syntax for changing the opacity of color utilities that we recommend migrating to from utilities like bg-opacity-{value}:

    • Before: <div class="bg-black bg-opacity-25">
    • After: <div class="bg-black/25">
@Paprikas
Paprikas / notes.md
Created April 13, 2019 07:23 — forked from doejoe13/notes.md
How to run multiple Redis instances on Ubuntu 18.04

Create the directory for the new instance

$ sudo install -o redis -g redis -d /var/lib/redis2

Create a new configuration file

$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
@Paprikas
Paprikas / capistrano-sidekiq systemd rbenv manual.txt
Last active March 1, 2023 00:40
capistrano-sidekiq systemd rbenv solution. Default configs did not work for me, also there is no proper documentation, Here is what I did:
Copy sidekiq.service.capistrano.erb template from "capistrano-sidekiq" gem to "app/config/deploy/templates"
Rbenv default bundler path differs from default '/usr/local/bin/bundler'.
So you have to set "bundler_path" option in "app/config/deploy.rb".
Here is mine:
set :bundler_path, "/usr/local/rbenv/bin/rbenv exec bundle"
And don't forget to add option to switch to systemd
timedatectl set-local-rtc 1 --adjust-system-clock
@Paprikas
Paprikas / install_phantomJs.sh
Created April 3, 2018 15:59 — forked from ManuelTS/install_phantomJs.sh
This script installs PhantomJS on your Debian/Ubuntu System
#!/usr/bin/env bash
# This script installs PhantomJS on your Debian/Ubuntu System
#
# Taken from https://gist.github.com/julionc/7476620#gistcomment-2030572 and changed the download directory
#
# This script must be run as root:
# sudo sh install_phantomjs.sh
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
@Paprikas
Paprikas / ElasticSearch.sh
Last active April 15, 2016 07:18 — forked from ricardo-rossi/ElasticSearch.sh
Installing ElasticSearch on Ubuntu 14.04 14.10 15.04 15.10 16.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh will install Elasticsearch 2.x
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
### ElasticSearch version
@Paprikas
Paprikas / date table.txt
Last active October 24, 2015 18:11 — forked from bryhal/gist:4129042
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...
@Paprikas
Paprikas / Morpher usage example.rb
Last active May 26, 2016 20:09
Model for work with http://morpher.ru/ service
Usage example:
>> text = Morpher.new('Большой город')
{:Р=>"Большого города", =>"Большому городу", =>"Большой город", :Т=>"Большим городом", =>"Большом городе", :П_о=>"о Большом городе", :род=>"Мужской", :множественное=>{=>"Большие города", :Р=>"Больших городов", =>"Большим городам", =>"Большие города", :Т=>"Большими городами", =>"Больших городах", :П_о=>"о Больших городах"}, :где=>"в Большом городе", :куда=>"в Большой город", :откуда=>"из Большого города"}
>> text.singular('Д')
"Большому городу"
>> text.plural('Д')
@Paprikas
Paprikas / gist:5037584
Created February 26, 2013 10:43
Jquery tools Datepicker Ru Localization
$.tools.dateinput.localize("ru", {
months: 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь',
shortMonths: 'Янв,Фев,Мар,Апр,Май,Июн,Июл,Авг,Сен,Окт,Ноя,Дек',
days: 'воскресенье,понедельник,вторник,среда,четверг,пятница,суббота',
shortDays: 'Вс,Пн,Вт,Ср,Чт,Пт,Сб'
});
$("#element").dateinput({
lang: 'ru',
format: 'dd.mm.yyyy',