Skip to content

Instantly share code, notes, and snippets.

View sup2007's full-sized avatar
💭
🚀

Алексей Добрый sup2007

💭
🚀
View GitHub Profile
@sup2007
sup2007 / phone_regexp.md
Last active December 4, 2025 20:15 — forked from fearrr/phone_regexp.md
Регулярное выражение для мобильных и городских номеров России и СНГ

Регулярное выражение для мобильных и городских телефонных номеров России и СНГ

Страны СНГ (2025):

  • Азербайджан +994
  • Армения +374
  • Грузия +995
  • Беларусь +375
  • Казахстан +7
  • Киргизия +996
@sup2007
sup2007 / ifupdown-to-netplan.md
Last active February 16, 2023 15:48 — forked from mss/ifupdown-to-netplan.txt
Migrate from ifupdown to netplan on Ubuntu 20>22 LTS

Tested on an upgraded Ubuntu 20.04 Server to Ubuntu 22.04 Server

If not exists

apt install netplan.io 
systemctl unmask systemd-networkd.service
@sup2007
sup2007 / extend.sh
Created March 3, 2022 21:33 — forked from wvengen/extend.sh
Extend non-HiDPI external display above HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
@sup2007
sup2007 / Nginx + Apache reverse proxy REAL IP.md
Created December 9, 2021 12:54 — forked from louisbels/Nginx + Apache reverse proxy REAL IP.md
Real IP for Apache (Nginx reverse proxy)

NGINX 1.10 + APACHE 2.4 real IP for reverse proxy

Edit nginx conf

default.conf or what you want

vim /etc/nginx/conf.d/default.conf

add proxy_set_header for php files

@sup2007
sup2007 / typescript-vue.md
Created January 12, 2021 11:03 — forked from RISCfuture/typescript-vue.md
Adding TypeScript to a Rails + Webpacker + Vue project

Adding TypeScript to a Rails + Webpacker + Vue project

These instructions assume you already have a Rails 5.2 project using Webpacker 4 with Vue 2 and Vuex 3. I'll show you how to add TypeScript to the project, and type-safe your Vue components, including single-file components (SFCs). This document will not teach you TypeScript syntax or type theory. It also assumes your code already works without TypeScript. You shouldn't use this article to, for example, get started with Vuex, because I'm leaving out lots of necessary boilerplate code and focusing just on TypeScript changes.

If you want to see a commit on a project accomplishing this migration, visit https://github.com/RISCfuture/AvFacts/commit/666a02e58b4626a074a03812ccdd193a3891a954.

Setup

  1. Run rails webpacker:install:typescript. This should modify config/webpacker.yml and config/webpack/environment.js (leave those changes), add tsconfig.json and config/webpack/loaders/typescript.js (leave those files), and add some other files in `a