Skip to content

Instantly share code, notes, and snippets.

View mirfilip's full-sized avatar

Mirosław Filip mirfilip

  • Schibsted Tech Polska
  • Cracow
View GitHub Profile
@laureen71
laureen71 / nginx.conf RTMP Server
Last active June 1, 2023 14:45
TLS encapsulation RTMP Traffic (RTMPS) with nginx stream module
load_module modules/ngx_rtmp_module.so;
...
rtmp {
server {
listen 0.0.0.0:1935;
# if you want to run all on one server, change port here, eg:
# listen 127.0.0.1:1936;
chunk_size 4000;
notify_method get;
interleave on;
@DanielMSchmidt
DanielMSchmidt / update-renovate.js
Created September 3, 2020 14:40
Generates renovate config to fix @types and package running out of sync
#!/usr/bin/env node
// Generates renovate config to fix @types and package running out of sync
// See https://github.com/renovatebot/renovate/issues/4893
const path = require("path");
const fs = require("fs");
// This script lies under scripts/update-renovate.js, therefore the ..
const renovatePath = path.resolve(__dirname, "../renovate.json");
@daleyjem
daleyjem / deep-imports.md
Last active August 7, 2023 07:07
Explanation of a "deep import"

Deep Imports

Description

A "deep import" is simply an ESM import that goes deeper than the package root:

import thingA from 'my-package-name/src/components/thingA'
import thingB from '@my-namespace/my-package-name/src/components/thingA'
@emonigma
emonigma / dedup-iMovie-library.py
Last active March 19, 2021 03:10
When you import movies into iMovie 10 libraries, the file is always copied, wasting space and hindering editability. This script replaces the copy with a symlink, reclaiming disk space.
#!/usr/bin/env python3
#
# Usage: dedup-imovie-library.py LIBRARY ORIGINALS
#
# Public gist:
# https://gist.github.com/miguelmorin/92cd8b820fd0135bf0f7d5fea90dc3f1
#
# This code was inspired by this post and gist, and converted to Python
# https://benhollis.net/blog/2014/06/28/hard-linking-videos-to-save-space-in-your-imovie-library/
# https://gist.github.com/bhollis/6682c8b6b6357e2fedc5
@dvf
dvf / change-codec.md
Last active May 7, 2024 12:42
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@aescarcha
aescarcha / nodeAsyncTest.js
Created September 25, 2018 07:03
Javascript async / await resolving promises at the same time test
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, time);
});
}
@gtnsimon
gtnsimon / doctrine_validator_swagger.md
Last active February 26, 2024 12:14
Doctrine ORM + Symfony Validator + Swagger-PHP annotations living together 🙌❤

This solve Exceptions below :

  • Doctrine\Common\Annotations\AnnotationException : [Semantical Error] The annotation "..." in property Class::$property does not exist, or could not be auto-loaded.
  • Doctrine\ORM\Mapping\MappingException : Class "..." is not a valid entity or mapped super class.

Packages

@fesor
fesor / pre-commit
Last active March 16, 2022 06:12
php-cs-fixer pre-commit hook
#!/usr/bin/env bash
echo "php-cs-fixer pre commit hook start"
PHP_CS_FIXER="bin/php-cs-fixer"
PHP_CS_CONFIG=".php_cs"
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php')
if [ -n "$CHANGED_FILES" ]; then
$PHP_CS_FIXER fix --config "$PHP_CS_CONFIG" $CHANGED_FILES;
git add $CHANGED_FILES;
@troyfontaine
troyfontaine / 1-setup.md
Last active May 3, 2024 10:52
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.