This file contains hidden or 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
#!/usr/bin/env python | |
import sys | |
import pandas as pd | |
if len(sys.argv) != 3: | |
print('Usage: %s infile.json outfile.parquet') | |
sys.exit(-1) | |
infile = sys.argv[1] |
This file contains hidden or 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
#!/usr/bin/env python | |
import sys | |
import json | |
import requests | |
import xml.etree.ElementTree as ET | |
def fetch_sitemap_urls(url: str, seen=None) -> list[str]: | |
if seen is None: | |
seen = set() |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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'); |
NewerOlder