View .zshrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%(!.#.$) ' |
View sysctl.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net.inet.tcp.keepidle=20000 | |
net.inet.tcp.keepintvl=20000 | |
net.inet.tcp.keepinit=20000 | |
net.inet.tcp.always_keepalive=1 |
View DefaultKeyBinding.dict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
/* | |
~/Library/KeyBindings/DefaultKeyBinding.dict | |
*/ | |
// Home/End Keys | |
"\UF729" = "moveToBeginningOfLine:"; // Home | |
"\UF72B" = "moveToEndOfLine:"; // End | |
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; // Shift + Home | |
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; // Shift + End |
View aws_codepipeline_lambda_invalidate_cloudfront.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = job.data.actionConfiguration.configuration.UserParameters; | |
try { | |
let params = JSON.parse(config); | |
if (!params || !params.distributionId) { |
View install_php_pecl_ssh2.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo yum install php-pecl-ssh2 -y |
View buildspec.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
install: | |
runtime-versions: | |
nodejs: 12 | |
build: | |
commands: | |
- npm install | |
- npm run build -- --mode=production |
View Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.4-cli | |
ARG SWOOLE_VERSION=swoole | |
RUN apt-get update -q | |
RUN apt-get install -y --no-install-recommends \ | |
libssl-dev | |
RUN docker-php-ext-install \ | |
opcache |
View install_pecl_imagick_amzn2.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 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 |
View throwable_chaining.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface Throwable | |
{ | |
/** | |
* Return immutable copy with causal chain extended by given root cause | |
* | |
* @return Throwable | |
*/ | |
public function chain(Throwable $cause = null): Throwable; |
View overload.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
function overload(callable ...$implementations): callable | |
{ | |
return function (...$args) use ($implementations) { | |
$error = new \LogicException('Invalid overloaded implementations'); | |
foreach ($implementations as $candidate) { | |
try { | |
return $candidate(...$args); |
NewerOlder