Skip to content

Instantly share code, notes, and snippets.

sshymko / .zshrc
Last active Jan 4, 2022
Zsh configuration of cursor navigation and colors
View .zshrc
autoload -U select-word-style
select-word-style bash
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export PROMPT='%F{cyan}%n%f@%F{green}%m:%f%B%F{yellow}%0~%f%b%(!.#.$) '
sshymko / sysctl.conf
Created Dec 1, 2021
macOS TCP connection keep alive
View sysctl.conf
sshymko / DefaultKeyBinding.dict
Last active Dec 1, 2021
macOS key mapping for PC keyboard navigation
View DefaultKeyBinding.dict
// Home/End Keys
"\UF729" = "moveToBeginningOfLine:"; // Home
"\UF72B" = "moveToEndOfLine:"; // End
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; // Shift + Home
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; // Shift + End
sshymko / aws_codepipeline_lambda_invalidate_cloudfront.js
Last active Jul 12, 2022
Invalidate CloudFront distribution from CodePipeline via Lambda function
View aws_codepipeline_lambda_invalidate_cloudfront.js
const aws = require('aws-sdk');
const codepipeline = new aws.CodePipeline();
const cloudfront = new aws.CloudFront();
exports.handler = async (event, context) => {
let job = event['CodePipeline.job'];
let config =;
try {
let params = JSON.parse(config);
if (!params || !params.distributionId) {
sshymko /
Created Oct 14, 2020
Install SSH2 PHP7 extension on Amazon Linux 2
sudo yum install php-pecl-ssh2 -y
sshymko / buildspec.yml
Created Aug 27, 2020
AWS CodeBuild specification for single-page application (SPA) managed by NPM
View buildspec.yml
version: 0.2
nodejs: 12
- npm install
- npm run build -- --mode=production
sshymko / Dockerfile
Last active Aug 25, 2020
Docker PHP with OPcache and Swoole extension & OpenSSL support
View Dockerfile
FROM php:7.4-cli
RUN apt-get update -q
RUN apt-get install -y --no-install-recommends \
RUN docker-php-ext-install \
sshymko /
Last active Dec 23, 2022
Install latest ImageMagick 7.x and imagick PHP extension from PECL on Amazon Linux 2
# Uninstall ImageMagic library and imagick PHP extension using it (installed previously)
yum remove -y php-pecl-imagick ImageMagick
# Install libraries for JPG, PNG, GIF, WebP, and TIFF image formats
yum install -y libpng-devel libjpeg-devel openjpeg2-devel libtiff-devel libwebp-devel giflib-devel
# Install latest ImageMagick library compiled from downloaded sources
yum install -y gcc
sshymko / throwable_chaining.php
Created Feb 15, 2020
Chaining of immutable throwable exceptions/errors (PHP8 proposal)
View throwable_chaining.php
interface Throwable
* Return immutable copy with causal chain extended by given root cause
* @return Throwable
public function chain(Throwable $cause = null): Throwable;
sshymko / overload.php
Last active Feb 16, 2020
PHP7 function/method signature overloading
View overload.php
function overload(callable ...$implementations): callable
return function (...$args) use ($implementations) {
$error = new \LogicException('Invalid overloaded implementations');
foreach ($implementations as $candidate) {
try {
return $candidate(...$args);