Skip to content

Instantly share code, notes, and snippets.

View ASRagab's full-sized avatar
👨‍💻

Ahmad Ragab ASRagab

👨‍💻
View GitHub Profile
@ASRagab
ASRagab / tapirdemo.scala
Last active April 21, 2023 03:44
ZIO Tapir Issue Reproduction
//> using scala "2.13.10"
//> using dep "dev.zio::zio:2.0.13"
//> using dep "dev.zio::zio-http:0.0.5"
//> using dep "com.softwaremill.sttp.tapir::tapir-zio-http-server:1.2.12"
//> using dep "com.softwaremill.sttp.tapir::tapir-core:1.2.12"
//> using dep "com.softwaremill.sttp.tapir::tapir-swagger-ui-bundle:1.2.12"
/**
* This is a simple example of using ZIO Tapir to create an HTTP server.
comparing metrics from 2023-03-03T15:28:12Z to 2023-03-03T15:58:12Z
[search-xaragab0main, 1707 series]
debug: http://prometheus.search-infra.etsy-searchinfra-gke-dev.etsycloud.com/api/v1/label/__name__/values?match%5B%5D=%7Bnamespace%3D%22search-xaragab0main%22,service%3D%22mmx-slv2-service%22%7D&start=2023-03-03T15:28:12Z&end=2023-03-03T15:58:12Z
[search-xaragab1dev, 1695 series]
debug: http://prometheus.search-infra.etsy-searchinfra-gke-dev.etsycloud.com/api/v1/label/__name__/values?match%5B%5D=%7Bnamespace%3D%22search-xaragab1dev%22,service%3D%22mmx-slv2-service%22%7D&start=2023-03-03T15:28:12Z&end=2023-03-03T15:58:12Z
command: git diff --no-index /tmp/search-xaragab0main-14985759052164331670.tmp /tmp/search-xaragab1dev-1694701381650067377.tmp
ERROR: An error occurred during the fetch of repository 'etsy_jsonnet_libs':
Traceback (most recent call last):
File "/private/var/tmp/_bazel_aragab/ddfb4cc2327ffd93ef312f575703d2ec/external/bazel_tools/tools/build_defs/repo/git.bzl", line 181, column 30, in _git_repository_implementation
update = _clone_or_update(ctx)
File "/private/var/tmp/_bazel_aragab/ddfb4cc2327ffd93ef312f575703d2ec/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, column 20, in _clone_or_update
git_ = git_repo(ctx, directory)
File "/private/var/tmp/_bazel_aragab/ddfb4cc2327ffd93ef312f575703d2ec/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 91, column 12, in git_repo
_update(ctx, git_repo)
File "/private/var/tmp/_bazel_aragab/ddfb4cc2327ffd93ef312f575703d2ec/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 103, column 10, in _update
fetch(ctx, git_repo)
@ASRagab
ASRagab / snippet.sh
Last active November 25, 2020 22:46
read from bucket after date
aws s3api list-objects --bucket "bucket" --prefix "optional" --query "Contents[?LastModified>='date'][].{Key: Key, LastModified: LastModified}"
@ASRagab
ASRagab / environment-tf16.yml
Last active November 16, 2020 02:01
Fourth Brain Conda Environments
name: fourth-brain-tf16
channels:
- defaults
- conda-forge
dependencies:
- pip
- tensorflow=1.6
- keras=2.2.4
- seaborn
- pillow
@ASRagab
ASRagab / parallel
Created March 4, 2020 21:05 — forked from mjambon/parallel
bash: Run parallel commands and fail if any of them fails
#! /bin/bash
#
# Run parallel commands and fail if any of them fails.
#
set -eu
pids=()
for x in 1 2 3; do
@ASRagab
ASRagab / README.md
Last active June 20, 2019 17:19
Moto TNT Presentation

Instructions

pip install boto3 moto 'moto[server]'

Usage

To start moto server for sqs (ONLY FOR NON BOTO TESTING):

@ASRagab
ASRagab / algos.md
Last active July 14, 2024 18:35
Algos and Data Structures

Topics

Algos

  1. Baby Gin Problem
  2. Lexicographic–Order
  3. Johonson-Trotter
  4. Minimum-exchange Requirement
  5. Knapsack Problem and Fractional Knapsack Method
  6. Huffman coding
@ASRagab
ASRagab / StreamZipper.scala
Created February 18, 2019 20:05
StreamZipper with Comonad Instance
import cats._
import cats.implicits._
case class StreamZipper[A](left: Stream[A], focus: A, right: Stream[A]) {
def moveLeft: StreamZipper[A] =
if (left.isEmpty) this
else new StreamZipper[A](left.tail, left.head, focus #:: right)
def moveRight: StreamZipper[A] =
if (right.isEmpty) this
@ASRagab
ASRagab / recursionSchemes.scala
Last active October 7, 2018 08:18
Sample implementation
package Other
import scalaz.Functor
import scala.language.higherKinds
object exampleList {
sealed trait mList
case object mNil extends mList