Skip to content

Instantly share code, notes, and snippets.

View DKepov's full-sized avatar
💭
🏡 Working

Dmitriy Kepov DKepov

💭
🏡 Working
View GitHub Profile
@DarkGhostHunter
DarkGhostHunter / log-levels.csv
Last active March 12, 2022 04:38
Log levels table
Property / Log Level Debug Info Notice Warning Error Critical Alert Emergency
Disposable X
Statistical X X X X X X X
Relevant X X X X X X
Undersired X X X X X
Unstable X X X X
Stateful X X X
Unsecure X X
Unfixable X
type SubscribedEvent = (...args) => any;
class EventObserver {
public events: SubscribedEvent[] = [];
subscribe(fn: SubscribedEvent) {
this.events.push(fn)
}
unsubscribe(fn: SubscribedEvent) {
/**
* Класс Singleton предоставляет метод getInstance, который позволяет клиентам
* получить доступ к уникальному экземпляру одиночки.
*/
class Singleton {
private static instance: Singleton;
/**
* Конструктор Singleton должен быть приватный, чтобы кто-нибудь случайно не создал
* объект через оператор new.
@albe-rosado
albe-rosado / ubuntu-nm-wiregard.sh
Created May 8, 2021 22:42
Command to install Ubuntu Wireguard network manager plugin
# instal dependencies
sudo apt install wireguard git dh-autoreconf libglib2.0-dev intltool build-essential libgtk-3-dev libnma-dev libsecret-1-dev network-manager-dev resolvconf
# clone repo and build
git clone https://github.com/max-moser/network-manager-wireguard
cd network-manager-wireguard
./autogen.sh --without-libnm-glib
./configure --without-libnm-glib --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/NetworkManager --localstatedir=/var
@ahmedash95
ahmedash95 / README.md
Created March 4, 2020 23:42
Laravel Eloquent Collection set relations

Usage

// Instead Of

$categories = Category::all();

$products = Products::all();

$products->each(function($product) use ($categories) {
@CrabAss
CrabAss / firefox-x11.md
Last active March 9, 2023 12:39
How to remotely run Firefox on Ubuntu Server 18.04

How to remotely run Firefox on Ubuntu Server 18.04

My environment

  • Ubuntu Server 18.04 on my local Hyper-V (on Windows 10 Pro 19H2)
  • SSH client: Xshell 6

Procedure

Configure X11 Forwarding

@daopk
daopk / git-config-http-version.md
Last active February 22, 2025 09:40
Fix error : RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
git config --global http.version HTTP/1.1
git config --global http.postBuffer 157286400
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active April 18, 2025 18:48
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

// This injects a box into the page that moves with the mouse;
// Useful for debugging
async function installMouseHelper(page) {
await page.evaluateOnNewDocument(() => {
// Install mouse helper only for top-level frame.
if (window !== window.parent)
return;
window.addEventListener('DOMContentLoaded', () => {
const box = document.createElement('puppeteer-mouse-pointer');
const styleElement = document.createElement('style');
@iPublicis
iPublicis / trelloinstall.sh
Last active July 16, 2024 16:40
Install Trello Linux Client
#!/bin/bash
# Your system should be 64 bits and check if the last version at https://github.com/danielchatfield/trello-desktop/ is 0.19
# If the current version is not 0.19 change the file name below accordingly
wget https://github.com/Racle/trello-desktop/releases/download/v0.2.0/Trello-linux-0.2.0.zip -O trello.zip
sudo mkdir /opt/trello
sudo unzip trello.zip -d /opt/trello/
sudo ln -sf /opt/trello/Trello /usr/bin/trello
echo -e '[Desktop Entry]\n Version=1.0\n Name=Trello Desktop\n Exec=/usr/bin/trello\n Icon=/opt/trello/resources/app/static/Icon.png\n Type=Application\n Categories=Application' | sudo tee /usr/share/applications/trello.desktop