Skip to content

Instantly share code, notes, and snippets.

View devellopah's full-sized avatar

Islam Ibakaev devellopah

  • 02:27 (UTC +03:00)
View GitHub Profile
<?php
namespace App\Http\Controllers;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Inertia\Response;
class MyController extends Controller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\View\View;

Open terminal
ssh-keygen -t ed25519 -C "your key title"
Provide path to custom-named ssh key
Enter a passphrase (twice for verification)
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ssh_key_custom_name
cat ~/.ssh/id_ssh_key_custom_name.pub | clip
Add new ssh key(github settings - ssh and gpg keys)
Test the setting with ssh -T git@github.com

POSTS:

Get a post by id:

http://mixmeals.com/wp-json/wp/v2/posts/?filter[p]=12

Get multiple posts by id:

http://mixmeals.com/wp-json/wp/v2/posts/?include=470,469

@devellopah
devellopah / .htaccess
Created September 8, 2021 15:43
wordpress .htaccess
<IfModule mod_rewrite.c>
#Close the listing of files and folders
Options +FollowSymLinks -Indexes
#Activate mod_rewrite extension
RewriteEngine On
#### @RS
# Block out any script trying to base64_encode data within the URL.
@devellopah
devellopah / Profile.js
Last active December 9, 2020 14:13
get profile data using axios
// Add brand new file
import axios from 'axios'
export default class Profile {
constructor() {
this.profileNav = document.querySelector('.profile-nav')
this.profileContent = document.getElementById('profileContent')
this.username = document.getElementById('username').textContent
this.events()
@devellopah
devellopah / REST API.md
Created September 15, 2020 18:55 — forked from fomvasss/REST API.md
Best practices Laravel Rest API

Best practices написание REST-API

  • Имена полей в ответе задавать в snake_case (prr_page, created_at, system_name,...)
  • Для времени использовать ISO 8601 (формат: YYYY-MM-DDTHH:MM:SSZ)
  • Отдавать данные (сам контент, поля сущностей, массивы сущностей), помещая их в data

Использование REST методов и примеры url'ов

  • GET: /api/users — получить список пользователей;
  • GET: /api/users/123 — получить указанного пользователя;
  • POST: /api/users — создать нового пользователя;
@devellopah
devellopah / custom.html
Last active June 9, 2020 07:58
custom radio and checkbox
<!DOCTYPE html>
<html>
<style>
.custom-input {
font-size: 16px;
letter-spacing: 0.2px;
padding-left: 40px;
font-family: "Fira Sans SemiBold";
margin: 0 0 26px 0;
padding-top: 4px;
@devellopah
devellopah / sane-caching.nginx.conf
Created November 26, 2019 16:55 — forked from philipstanislaus/sane-caching.nginx.conf
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@devellopah
devellopah / default.conf
Created November 24, 2019 09:53
nginx config
server {
listen 80 default_server;
listen [::]:80 default_server;
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;