Skip to content

Instantly share code, notes, and snippets.

View BoShurik's full-sized avatar

Alexander Borisov BoShurik

  • Amicus
  • Vladimir, Russia
View GitHub Profile
@noplanman
noplanman / upgrade-nghttp2
Last active November 17, 2020 23:50
Upgrade nghttp2 for brew with a fix for older MacOS versions
#!/usr/bin/env bash
# Update brew repo.
printf "%s" "Updating brew repo..."
brew update &> /dev/null
echo ""
# Get the currently installed and new version of nghttp2.
printf "%s" "Fetch installed and stable nghttp2 versions..."
VERSION_INSTALLED="$(brew list --versions | grep nghttp2 | awk '{print $2}')"
@lyrixx
lyrixx / HardCoreDebugLogger.php
Last active December 7, 2023 14:14
Hardcore Debug Logger
<?php
const STREAM_OPEN_FOR_INCLUDE = 128;
final class HardCoreDebugLogger
{
public static function register(string $output = 'php://stdout')
{
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
@mrmartineau
mrmartineau / stimulus.md
Last active March 21, 2024 17:51
Stimulus cheatsheet
@ostrolucky
ostrolucky / UniqueDTO.php
Created December 17, 2017 01:20
UniqueDTOValidator
<?php
declare(strict_types=1);
namespace App\Validator\Constraints;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* Checks if entity associatied to DTO is unique.
@ViktorNova
ViktorNova / rotate-video.sh
Created August 8, 2016 21:33
Rotate a video with FFmpeg (100% lossless, and quick)
$INPUTVIDEO='input.mp4'
$OUTPUTVIDEO='output.mp4'
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO
@eloypnd
eloypnd / dnsmasq_setup_osx.md
Last active March 23, 2024 00:25
wildcard DNS record on OS X in localhost development with dnsmasq

wildcard DNS in localhost development

$ brew install dnsmasq
   ...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
  • edit /usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
@fracsi
fracsi / !dsn_handler_for_swiftmailer.php
Last active December 21, 2020 21:11
DSN Feature for SwiftMailer
<?php
$mailer = Swift_Mailer::newInstance(
Swift_SmtpTransport::newInstance('smtp.example.org', 25)
);
// NOTIFY=NEVER
$mailer->registerPlugin(new DsnPlugin([new NotifyHandler('never')]));
// --- OR ---
@alcaeus
alcaeus / DataObject\PostCount.php
Created May 25, 2015 15:53
Hydrated aggregation results with Doctrine ODM
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@denji
denji / README.md
Last active January 30, 2024 12:21 — forked from istepanov/gist:3950977
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm