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
@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 / 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

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
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>>] {
@magl88
magl88 / nextjs-deploy.md
Created June 11, 2023 00:03 — forked from jjcodes78/nextjs-deploy.md
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw