Skip to content

Instantly share code, notes, and snippets.

View daniel-cortez-stevenson's full-sized avatar
🦊
I'm around

Daniel daniel-cortez-stevenson

🦊
I'm around
View GitHub Profile
@mjf
mjf / Postgres.md
Last active November 4, 2024 08:55
Postgres

⚠️ WARNING
The ordering of listed projects or documents is random and has no connection to relevance or maturity levels!

Postgres

Extensions

Extension Description
pgaudit Postgres auditing extension
pg_dbms_metadata extract Postgres object metadata

Using GPG with sbtenv on MacOS

Issue

I rececently downloaded sbtenv to better manage my Scala SBT environmnets per project. When I tried to install any version of SBT using the sbtenv command - it would fail. Checking the stdout I found the message gpg: Can't check signature: No public key at the end of the output.

Steps to reproduce

Install sbtenv

@daniel-cortez-stevenson
daniel-cortez-stevenson / elasticsearch-service-template.yaml
Last active December 15, 2023 09:50
AWS ElasticSearch Domain with VPC and Bastion Cloudformation Template
# Copyright 2020 Daniel Cortez Stevenson
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@daniel-cortez-stevenson
daniel-cortez-stevenson / snowball_stemmer.py
Last active December 15, 2023 09:49
Wrapping Scala with Python for PySpark Example (org.apache.spark.mllib.feature.Stemmer)
"""An example of wrapping a Scala UDF with Python code.
Copyright 2020 Daniel Cortez Stevenson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
@niespodd
niespodd / limit_chromium_fps.patch
Last active May 13, 2024 18:48
Chromium patch to reduce CPU load on Swiftshader no-headless
/**
ref: https://cs.chromium.org/chromium/src/components/viz/common/frame_sinks/begin_frame_args.h?q=60hz&dr=C&l=11
The original 16666 corresponds to 60 Hz/FPS: (1 / 60) * 10^6 = 16666μs
**/
diff --git a/components/viz/common/frame_sinks/begin_frame_args.h b/components/viz/common/frame_sinks/begin_frame_args.h
index c4d0e29c7d65..a39ede9849c6 100644
--- a/components/viz/common/frame_sinks/begin_frame_args.h
+++ b/components/viz/common/frame_sinks/begin_frame_args.h
@@ -91,7 +91,8 @@ struct VIZ_COMMON_EXPORT BeginFrameArgs {
from airflow import DAG
from airflow.operators import DummyOperator, PythonOperator
default_args = {
'owner': 'arnaud',
'start_date': datetime(2019, 1, 1),
'retry_delay': timedelta(minutes=5)
}
# Using the context manager alllows you not to duplicate the dag parameter in each operator
with DAG('S3_dag_test', default_args=default_args, schedule_interval='@once') as dag:
@kppullin
kppullin / airflow-k8s-executor-minikube-helm.md
Last active September 12, 2022 19:47
Airflow w/ kubernetes executor + minikube + helm

Overview

The steps below bootstrap an instance of airflow, configured to use the kubernetes airflow executor, working within a minikube cluster.

This guide works with the airflow 1.10 release, however will likely break or have unnecessary extra steps in future releases (based on recent changes to the k8s related files in the airflow source).

Prerequisites

  • Docker installed
  • Minikube installed and started
@jancurn
jancurn / hello_world.js
Created September 24, 2018 14:03
Apify SDK hello world example
const Apify = require('apify');
Apify.main(async () => {
const requestQueue = await Apify.openRequestQueue();
await requestQueue.addRequest(new Apify.Request({ url: 'https://www.iana.org/' }));
const pseudoUrls = [new Apify.PseudoUrl('https://www.iana.org/[.*]')];
const crawler = new Apify.PuppeteerCrawler({
requestQueue,
handlePageFunction: async ({ request, page }) => {
@milesrichardson
milesrichardson / s3download_promise.js
Created August 11, 2017 16:27
S3 download promise: nodeJS promise to download file from amazon S3 to local destination
const AWS = require('aws-sdk');
const fs = require('fs')
const s3download = (bucketName, keyName, localDest) => {
if (typeof localDest == 'undefined') {
localDest = keyName;
}
let params = {