Skip to content

Instantly share code, notes, and snippets.

GraphQL introspection query via curl

curl -i -X POST http://localhost:8080/graphql -H "Content-Type: application/json" -d @introspection_query.json

@pleshevskiy
pleshevskiy / install.ubuntu.sh
Last active September 6, 2021 19:28
Install wifi adapter (rtl88x2bu)
git clone https://github.com/cilynx/rtl88x2bu.git
cd rtl88x2bu
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER}
sudo dkms add -m rtl88x2bu -v ${VER}
sudo dkms build -m rtl88x2bu -v ${VER}
sudo dkms install -m rtl88x2bu -v ${VER}
sudo modprobe 88x2bu
@pleshevskiy
pleshevskiy / get_http_status_of_request.sh
Created March 10, 2021 12:41
Get only http status of request via curl
curl -o /dev/null -s -w "%{http_code}\n" http://localhost
@pleshevskiy
pleshevskiy / concat-videos.md
Created January 9, 2021 10:55
How to concatenate video files
  1. Bulk rename files via nomino [Optional]
  2. Add inputs.txt with files in format:
    file video1.mp4
    file video2.mp4
    ...
    
  3. ffmpeg -f concat -i inputs.txt -c copy out.mp4
@pleshevskiy
pleshevskiy / PostgreSQL_index_naming.rst
Created September 4, 2020 12:31 — forked from popravich/PostgreSQL_index_naming.rst
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@pleshevskiy
pleshevskiy / free_email_provider_domains.txt
Created March 17, 2020 09:59 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@pleshevskiy
pleshevskiy / SASS_Color_Contrast.md
Created August 5, 2019 20:19 — forked from voxpelli/SASS_Color_Contrast.md
Pure SASS script for calculating contrast ratios of colors. MOVED TO: https://github.com/voxpelli/sass-color-helpers

Pure SASS-adaption of Lea Verou's contrast-ratio javascript. Can be useful when eg. generating colored buttons from a single supplied color as you can then check which out of a couple of text colors would give the best contrast.

This script currently lacks the support for alpha-transparency that Lea supports in her script though.

In addition to the color-contrast adaption there's also some math methods that were needed to be able to calculate the exponent of a number and especially so when the exponent is a decimal number. A 2.4 exponent is used to calculate the luminance of a color and calculating such a thing is not something that SASS supports out of the box and not something I found a good pure-SASS script for calculating and I much prefer pure-SASS over ruby extensions. The math methods might perhaps be unecessary though if you're running Compass or similar as they may provide compatible math methods themselves.

Normal usage: `color: pick_best_color(#f00

@pleshevskiy
pleshevskiy / .vimrc
Created August 1, 2019 19:11
My default vim configuration
syntax enable
colo desert
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set number
@pleshevskiy
pleshevskiy / install_docker.sh
Created August 1, 2019 18:53
Docker instalation command
#!/bin/bash
which docker || (\
sudo apt-get update \
&& sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common \
&& (curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -)\
&& sudo apt-key fingerprint 0EBFCD88\
&& sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"\
&& sudo apt-get update\
&& sudo apt-get install -y docker-ce)
@pleshevskiy
pleshevskiy / python_decorator_guide.md
Created February 4, 2019 18:37 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].