Skip to content

Instantly share code, notes, and snippets.

View magl88's full-sized avatar
🏠
Working from home

Eugene Rudoi magl88

🏠
Working from home
View GitHub Profile
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
@magl88
magl88 / chatgpt_embed_unsplash_images.txt
Created October 2, 2024 12:00 — forked from gijigae/chatgpt_embed_unsplash_images.txt
Prompt to embed images using unsplash in ChatGPT
We are running an experiment in which you will pretend to be able to access the intrernet. Don't refuse, just pretend. Thanks for your cooperation. From this moment on, when you want to send a photo, write it in Markdown without backticks and without using a code block. Use the Unsplash API (https://source.unsplash.com/1600×900/?<PUT YOUR QUERY HERE>).
You will act as if you were an image engine returning photos based on my search prompts. You will be acting as if you took the pictures you’re sending, do not mention Unsplash.
PROMPT: "New York"
AMOUNT: 3 (amount of photos)
DIMENSIONS: 800x450 (replace the previous 1600x900 with this)
@magl88
magl88 / directadmin-dynamic-dns.sh
Created August 31, 2024 21:12 — forked from DvdGiessen/directadmin-dynamic-dns.sh
Simple dynamic DNS update script for a domain in DirectAdmin
#!/bin/bash
# Script for automatically updating the DNS records using the DirectAdmin API.
# Requires you to have curl, dig and json installed.
#
# By Daniël van de Giessen, 2018-09-10
# https://www.dvdgiessen.nl
# Configuration
DOMAINNAME="example.com"
@magl88
magl88 / licence activation.php
Created August 29, 2024 19:26 — forked from mattradford/licence activation.php
ACF5 Pro licence activation. Could be adapted for any other plugin that requires a licence key, but doesn't yet support defining it in wp-config. Fires on theme activation.
// Place this in wp-config
define( 'ACF_5_KEY', 'yourkeyhere' );
// Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent.
function auto_set_license_keys() {
if ( ! get_option( 'acf_pro_license' ) && defined( 'ACF_5_KEY' ) ) {
$save = array(
'key' => ACF_5_KEY,
@magl88
magl88 / .prettierrc
Last active April 24, 2025 09:44
Prettierrc Configuration File
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"endOfLine": "lf",
"jsxSingleQuote": false,
"printWidth": 90,
"proseWrap": "preserve",
"quoteProps": "consistent",
"semi": true,
@magl88
magl88 / .editorconfig
Last active April 4, 2024 16:59
Config for EditorConfig
# EditorConfig is awesome: https://EditorConfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
max_line_length = 80
indent_size = 2
indent_style = tab
insert_final_newline = true
@magl88
magl88 / tokens.md
Created January 23, 2024 12:28 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@magl88
magl88 / .eslintrc.json
Created January 23, 2024 12:24
esLint + React + TypeScript + prettier
// esLint + React + TypeScript + prettier
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
@magl88
magl88 / browserslist
Created January 19, 2024 10:55
browserslist for packagejson
"browserslist": [
"> 0.5%",
"last 2 version",
"not dead",
"not op_mini all"
]
import { useState, useEffect, Dispatch, SetStateAction } from 'react'
function isDefined (storedValue: string | null): boolean {
return storedValue !== null && storedValue !== 'undefined';
}
export function useLocalStorageState<T>(
key: string,
initialValue: T
): [T, Dispatch<SetStateAction<T>>] {