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 | |
return [ | |
'add' => fn ($a, $b) => $a + $b, | |
]; |
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
import boto3 | |
import json | |
# Warn if log retention is longer than 7 days | |
RETENTION_DAYS = 7 | |
# Warn if log group is storing more than 1GB of data | |
STORED_BYTES = 1024 * 1024 * 1024 | |
def print_warnings(log_groups): |
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
import { setTimeout } from 'timers/promises' | |
const pipe = async (context, ...callables) => | |
callables.length ? pipe(await callables.shift()(context), ...callables) : context | |
const flow = (...callables) => async (initial) => pipe(initial, ...callables) | |
// Use pipe to pass an initial value through the callables | |
console.log(await pipe( | |
12, | |
($) => $ * 2, |
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 | |
namespace App\Support; | |
use ArrayAccess; | |
use ArrayIterator; | |
use Illuminate\Support\Facades\Validator; | |
use Iterator; | |
use IteratorAggregate; |
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
services: | |
app: | |
image: app | |
build: . | |
depends_on: | |
- opensearch-node1 | |
environment: | |
- 'OPENSEARCH_HOSTS=["https://admin:admin@opensearch-node1:9200","https://admin:admin@opensearch-node2:9200","https://admin:admin@opensearch-node3:9200"]' | |
volumes: | |
- .:/var/app |
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
strategies = [ | |
{ | |
'type': str, | |
'return': lambda input: [input.strip()] if input.strip() else [], | |
}, | |
{ | |
'type': dict, | |
'return': lambda input: [input.get('name')] if input.get('name') else [], | |
}, | |
{ |
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
live_loop :snake_jazz do | |
with_fx :compressor do | |
with_fx :flanger, mix: rrand(0, 0.2) do | |
with_fx :reverb, amp: rrand(0, 0.6) do | |
with_fx :tanh, krunch: 2, mix: rrand(0, 0.2) do | |
with_fx :hpf, cutoff: 130 - rrand(0, 20), mix: rrand(0.9, 1) do | |
sample :drum_cymbal_open | |
sleep 0.75 | |
sample :drum_cymbal_pedal | |
sleep 0.5 |
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 crypto = require('crypto'); | |
const encrypt = (publicKey, message) => { | |
const key = Buffer.from(crypto.randomBytes(32), 'binary'); | |
const iv = crypto.randomBytes(16); | |
const cipher = crypto.createCipheriv('aes256', key, iv); | |
let data = cipher.update(message, 'utf8', 'base64'); | |
data += cipher.final('base64'); |
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
DefinitionBody: | |
swagger: 2.0 | |
info: | |
title: !Ref AWS::StackName | |
paths: | |
/ingest: | |
post: | |
consumes: | |
- application/json |
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 | |
class KeyHolder | |
{ | |
private $key; | |
public function __construct() | |
{ | |
$this->key = new class () { | |
private $resource; |
NewerOlder