Skip to content

Instantly share code, notes, and snippets.

View maks-rafalko's full-sized avatar

Maks Rafalko maks-rafalko

View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active June 9, 2025 16:35
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@hamburghammer
hamburghammer / add_CA_on_linux.md
Last active September 13, 2024 06:06 — forked from kekru/add CA cert on CentOS Debian Ubuntu.md
Add CA cert to local trust store on CentOS, Manjaro, Debian or Ubuntu
  • Open a webpage that uses the CA with Firefox
  • Click the lock-icon in the addressbar -> show information -> show certificate
  • the certificate viewer will open
  • click details and choose the certificate of the certificate-chain, you want to import to CentOS
  • click "Export..." and save it as .crt file
  • Copy the .crt file to /etc/pki/ca-trust/source/anchors on your CentOS machine
  • run update-ca-trust extract
  • test it with wget https://example.com

On Manjaro (arch) the location for the certificates is: /usr/share/ca-certificates/trust-source/anchors (low priority) or /etc/ca-certificates/trust-source/anchors/ (high priority) and the command to update is update-ca-trust extract.

@cuonghuynh
cuonghuynh / readme.md
Created October 22, 2018 07:45
Symfony: Mask sensitive data in the log file

Add processor to monolog handler

<service id="shopmacher.payment.logger.handler" class="Monolog\Handler\StreamHandler">
    //...
    <call method="pushProcessor">
        <argument type="service" id="service_processor.payment_logger_filtering" />
    </call>
</service>
@coderabbi
coderabbi / post-merge
Created December 18, 2017 11:27
'composer install' git post-merge hook
# .git/hooks/post-merge
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
composer_install_on_changed_lockfile() {
echo "$changed_files" | grep --quiet "composer.lock" &&
echo "Changes to 'composer.lock' detected; running 'composer install'." &&
composer install
}
@nopolabs
nopolabs / xdebug
Last active June 6, 2019 19:53
bash script to run php with xdebug enabled
#!/bin/bash
PHP=${PHP:-`which php`}
XDEBUG_INI=${XDEBUG_INI:-`${PHP} --ini | awk 'BEGIN { FS=","; } /xdebug.ini/ { print $1; }'`}
XDEBUG_HOST=${XDEBUG_HOST:-1.2.3.1}
XDEBUG_PORT=${XDEBUG_PORT:-9001}
IDE_KEY=${IDE_KEY:-PHPSTORM}
if [ "$1" = "--help" -o "$1" = "" ]
then
@ateucher
ateucher / setup-gh-cli-auth-2fa.md
Last active May 3, 2024 11:06
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email '[email protected]'
    
@benharold
benharold / xdebug
Created June 17, 2016 17:50
Bash script to toggle xdebug on/off on Mac OS X running PHP installed from Homebrew
#!/bin/bash
XDEBUG_INI_PATH="/usr/local/etc/php/7.0/conf.d/ext-xdebug.ini"
function turn_off {
`sed -i '' 's/^zend_extension/#zend_extension/g' $XDEBUG_INI_PATH`
}
function turn_on {
`sed -i '' 's/^#zend_extension/zend_extension/g' $XDEBUG_INI_PATH`
@Dr-Nikson
Dr-Nikson / README.md
Last active December 30, 2024 11:14
Auth example (react + redux + react-router)
@laracasts
laracasts / gist:f4a304232c1be6dbb4f8
Last active August 3, 2024 16:45
Laracasts PHPStorm theme.
@DavidFrahm
DavidFrahm / 020_build_version.js
Last active December 28, 2020 00:05
Cordova build hook, to use build version from config.xml in your hybrid app
#!/usr/bin/env node
// This plugin replaces text in a file with the app version from config.xml.
var wwwFileToReplace = "js/build.js";
var fs = require('fs');
var path = require('path');
var rootdir = process.argv[2];