Skip to content

Instantly share code, notes, and snippets.

View sovetski's full-sized avatar
🎯
Focusing

Ahliman HUSEYNOV sovetski

🎯
Focusing
View GitHub Profile
@codeadamca
codeadamca / mamp-php-versions.md
Last active October 8, 2024 05:59
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
@mikegogulski
mikegogulski / copy-stripe-setup.py
Last active October 11, 2024 14:45
Copy Stripe production products and prices to test environment
### The best way to start is to use the "Delete all test data" button at https://dashboard.stripe.com/test/developers
### Setup:
import stripe
test = 'sk_test_51IXXXyoursecretkey'
prod = 'sk_live_51IXXXyoursecretkey'
@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>
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active November 12, 2024 12:19
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.

@PARC6502
PARC6502 / OpenSourceBaas.md
Last active November 7, 2024 22:08
List of open source, self hosted BaaS - Backend as a service

Backend as a Service

Supabase - ~52K stars

  • Designed explicitly as an open source firebase alternative
  • Typescript based
  • Docker support

Appwrite - ~32K stars

  • Written in JavaScript and PHP
  • Docker based
  • Realtime support across all services
@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>
)
);
@cawa-93
cawa-93 / sideloader.function.php
Last active October 14, 2024 14:31 — forked from kellenmace/class-download-remote-image.php
Download and Insert a Remote Image File into the WordPress Media Library
<?php
namespace Plugin\Sideloader;
/**
* Function handles downloading a remote file and inserting it
* into the WP Media Library.
* @param string $url HTTP URL address of a remote file
* @param int $post_id The post ID the media is associated with
* @param string $desc Description of the side-loaded file
* @param string $post_data Post data to override