POST для создания новых ресурсов
POST для остальных кастомных глаголов
PATCH для обновления ресурсов. В 99,99% на обновление уходят не все поля ('created_at' и 'updated_at' так точно)
На PUT можно забить =)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((nm, tm) => { | |
const lStorage = localStorage; | |
const sStorage = sessionStorage; | |
const tabId = sStorage.getItem(tm) | |
|| ((newId) => { | |
sStorage.setItem(tm, newId); | |
return newId; | |
})((Math.random() * 1e8).toFixed()); | |
const update = (setTabValue) => { | |
let currentValue = JSON.parse(lStorage.getItem(nm) || '{}'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prune images | |
$ docker image prune | |
or | |
$ docker image prune -a | |
# Prune containers | |
$ docker container prune | |
# Prune volumes | |
$ docker volume prune |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ================================= | |
# List all node_modules | |
# Linux. | |
$ cd documents | |
$ find . -name "node_modules" -type d -prune -print | xargs du -chs | |
# Windows | |
$ cd documents | |
$ FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo %d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script for run localtunnel | |
# https://github.com/localtunnel/localtunnel | |
##### Constants | |
SUBDOMAIN='name' | |
PORT=8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Password (min 8 symbols, with spec symbols) | |
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/ | |
# Password (8-12 symbols, without spec symbols) | |
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,12})/ | |
# Percent (0 .. 100) | |
/^([0-9]{1,2}){1}(\.[0-9]*)?$|^(100)$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, remove the old version: | |
# If installed via apt-get | |
sudo apt-get remove docker-compose | |
# If installed via curl | |
sudo rm /usr/local/bin/docker-compose | |
# If installed via pip | |
pip uninstall docker-compose |
gource --seconds-per-day 1 -1280x720 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset veryslow -pix_fmt yuv420p -crf 22 -threads 0 -bf 0 video.mp4
OlderNewer