Skip to content

Instantly share code, notes, and snippets.

View sovetski's full-sized avatar
🎯
Focusing

Human HUMANOV sovetski

🎯
Focusing
View GitHub Profile
@codeadamca
codeadamca / mamp-php-versions.md
Last active June 25, 2024 13:16
How to add new PHP versions to MAMP on a Mac

Adding Versions of PHP to MAMP on a Mac

If you're working on a project that requires a version of PHP higher than the versions that MAMP comes with, you can easily add additional verions.

My version of MAMP came installed with PHP 7.4.21 and 8.0.8. I'm attempting to use MAMP to host a Laravel application which requires at least PHP 8.1.

The version of PHP MAMP uses is often different than the version you have installed. I have installed PHP using Brew. I'm currently running PHP 8.1.8. If you want to check your installed version of PHP, use the terminal and run the following command:

php --version
@mark-gerarts
mark-gerarts / OAuthConnectController.php
Last active June 21, 2024 12:09
HWIOAuthBundle connect functionality without FUB
<?php
namespace Acme\Controller;
use HWI\Bundle\OAuthBundle\Templating\Helper\OAuthHelper;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Http\Util\TargetPathTrait;
@patrickmaciel
patrickmaciel / configuracoes.md
Created April 18, 2021 00:30
Laragon + Mailhog
@btoo
btoo / .huskyrc.js
Last active June 17, 2024 07:55
husky pre-commit hook for handling ONLY staged files that will prevent commit if there are linting errors and auto-fix them
/**
* @see {@tutorial https://github.com/typicode/husky}
* _Requires Node >= 10 and Git >= 2.13.0._
*/
module.exports = {
hooks: {
/**
* @see {@tutorial https://stackoverflow.com/a/15656652/3942699}
*
* ___only works with files staged in git___
@BjornDCode
BjornDCode / gist:5cb836a6b23638d6d02f5cb6ed59a04a
Created February 3, 2020 11:58
Tailwind - Fixed sidebar, scrollable content
// Source: https://twitter.com/calebporzio/status/1151876736931549185
<div class="flex">
<aside class="h-screen sticky top-0">
// Fixed Sidebar
</aside>
<main>
// Content
</main>
@MikaelCarpenter
MikaelCarpenter / react-select-data-attributes.jsx
Created December 14, 2018 19:09
Solution for adding data attributes to a react-select component by passing in "custom components" where you've manipulated the innerProps prop
import React, { Component } from 'react';
import ReactSelect, { components } from 'react-select';
const TextOption = props => (
components.Option && (
<components.Option { ...props }>
...
</components.Option>
)
);
@kagg-design
kagg-design / full_list_of_wp_globals.php
Last active June 26, 2024 01:21
Full list of WordPress global variables, extracted from WP Coding Standards
<?php
/**
* List of global WP variables.
*
* @since 0.3.0
* @since 0.11.0 Changed visibility from public to protected.
* @since 0.12.0 Renamed from `$globals` to `$wp_globals` to be more descriptive.
* @since 0.12.0 Moved from WordPress_Sniffs_Variables_GlobalVariablesSniff to WordPress_Sniff
*
* @var array
@vuthaihoc
vuthaihoc / mamp_additional_php_versions.md
Created August 1, 2018 07:53
MAMP Additional PHP versions
@joeytwiddle
joeytwiddle / async-await-forEach-alternatives.md
Last active July 4, 2024 13:06
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for...i or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem

@egyjs
egyjs / Direct Link of YouTube videos.md
Last active April 17, 2024 06:38
PHP API To get Direct Link of YouTube videos