Skip to content

Instantly share code, notes, and snippets.

View KhodeN's full-sized avatar

Artem Berezin KhodeN

View GitHub Profile
@htr3n
htr3n / macos-ramdisk.md
Last active May 1, 2024 10:16
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

ExcelJS

Задача - сделать Excel-подобную таблицу с поддержкой простейших формул. Пересчёт значений в ячейках должен происходить сразу при потере фокуса и затрагивать только те ячейки, значения которых затронуты. Пересчитывать каждый раз всю таблицу (если нет необходимости) нельзя. Использовать чистый JS (ES6), HTML, CSS. Использовать стороннние фреймворки, библиотеки не надо. Только то, что предоставляет браузер. Будет проверяться на последней версии chrome (десктопный и мобильный).

Размер таблицы пусть будет 100x1000 (ШxВ)

@eladmoshe
eladmoshe / link-certificate.sh
Last active June 8, 2020 21:20
Script for linking a working certificate to create-react-app. Allows you to work with create-react-app and valid SSL certificate.
@KhodeN
KhodeN / psql_table_sizes.sql
Created March 30, 2018 03:58
Postgres table size in bytes
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_relation_size(C.oid)) AS "size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
and nspname = 'public'
and relkind = 'r'
ORDER BY pg_relation_size(C.oid) DESC;
@spyesx
spyesx / rsync_backup.sh
Last active February 16, 2024 14:03
Rsync backup excluding node_modules
# Backup files
#https://explainshell.com/explain?cmd=rsync+-azuv+--delete+--progress+--exclude+%27node_modules%27
rsync -auvhp --delete --exclude=node_modules [source] [destination]
# Remove all node_modules folders
# https://explainshell.com/explain?cmd=find+.+-name+%22node_modules%22+-type+d+-prune+-exec+rm+-rf+%27%7B%7D%27+%2B
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
@JBlond
JBlond / bash-colors.md
Last active May 6, 2024 18:01 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@dweldon
dweldon / meteor-nginx
Last active January 22, 2024 06:53
This is an example of how to configure nginx to serve a meteor app.
server {
listen [::]:80;
listen 80;
server_name app.example.com;
return 301 https://$server_name$request_uri;
}
server {
@puffy
puffy / postgresql os x ordering
Created February 11, 2012 16:38
Существует проблема сортировки текстовых полей postgresql на Mac OS X (возможно и FreeBSD, не знаю как сейчас) при использовании мультибайтовой кодировки UTF-8. Здесь приведен один из вариантов решения данной проблемы.
# psql -h localhost postgres
postgres=# create database mydb_test with lc_collate='C';
ERROR: new collation (C) is incompatible with the collation of the template database (ru_RU.UTF-8)
HINT: Use the same collation as in the template database, or use template0 as template.
postgres=# UPDATE pg_database SET datallowconn = TRUE WHERE datname = 'template0';
postgres=# create database mydb_test with lc_collate = 'C' template = template0;