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
git branch | grep -v "master" | xargs git branch -D | |
git branch | grep -v "development" | xargs git branch -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
docker run -d \ | |
--name redis-local \ | |
-p 6379:6379 redis:alpine redis-server \ | |
--appendonly yes \ | |
--requirepass xxxxx |
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
du -h /path/to/directory | sort -h |
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
SELECT * FROM information_schema.tables | |
WHERE table_schema = '[schema_name]' |
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
import dayjs from 'src/common/day'; | |
const k = 'abcdefghijklmnopqustuvwxyz0123456789'; | |
const generateBit = (word: number[], index: number) => | |
word[0] + index >= k.length | |
? k[(word[0] + index) % k.length] | |
: k[word[0] + index]; | |
const generateKey = (n: number, word: number[] = []) => { |
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
const crypto = require('crypto') | |
const checksum = (str, algorithm = 'md5', encoding = 'hex') => { | |
return crypto | |
.createHash(algorithm) | |
.update(str, 'utf8') | |
.digest(encoding) | |
} | |
module.exports = { |
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
create table m_data_1 as (select * from m_data); | |
create table m_data_2 as (select * from m_data) with no data; |
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
# place this after nvm initialization! | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
local nvmrc_path="$(nvm_find_nvmrc)" | |
if [ -n "$nvmrc_path" ]; then | |
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") | |
if [ "$nvmrc_node_version" = "N/A" ]; then | |
nvm install |
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
du -d 1 -h node_modules/ | grep prisma |
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
SELECT pg_terminate_backend(pg_stat_activity.pid) | |
FROM pg_stat_activity | |
WHERE pg_stat_activity.datname = 'db-name-1' | |
AND pid <> pg_backend_pid(); | |
CREATE DATABASE "db-name-2" | |
WITH TEMPLATE "db-name-1" | |
OWNER produsr; |
NewerOlder