Skip to content

Instantly share code, notes, and snippets.

View TomerAdmon's full-sized avatar

Tomer Admon TomerAdmon

  • Tel Aviv, Israel
View GitHub Profile
import requests
import time
base_url = "https://api.zafran.io/api/v2/"
key = ""
def export_init():
request_url = base_url + "findings/export"
headers = {
@TomerAdmon
TomerAdmon / user_limit.rego
Created March 5, 2024 11:41
limit space launches except for specific users
package torque.environment
import future.keywords.if
equals(a, b) {
a == b
}
contains_case_insensitive(arr, elem) {
echo URL Provided: ${FRONTEND_URL}
if [[ -z "${FRONTEND_URL}" ]]; then
printf 'No frontend value provided'
elif [[ "${FRONTEND_URL}" == *"localhost"* ]]; then
printf 'Using localhost'
else
frontend="${FRONTEND_URL}"
printf 'Waiting for ALB to be ready'
until $(curl --output /dev/null --silent --head --fail $frontend); do
printf '.'
from cloudshell.workflow.orchestration.sandbox import Sandbox
from cloudshell.workflow.orchestration.setup.default_setup_orchestrator import DefaultSetupWorkflow
from cloudshell.helpers.scripts.cloudshell_dev_helpers import attach_to_cloudshell_as
attach_to_cloudshell_as('admin', 'admin', 'Global', '16e8fb96-6678-4971-b0c3-5fae4276a9ef', 'localhost')
def configure_apps(sandbox, something):
"""
:param Sandbox sandbox:
:param dict[str, App] components
echo $Var
@TomerAdmon
TomerAdmon / scraper.py
Last active December 9, 2021 19:45
Scrape frames from live stream
##
## This code will download frames from a live stream and save them as "frame%d.jpg" in your disk"
## make sure you are using python3 and downloading the opencv-python package
## to get the stream url, see: https://stackoverflow.com/a/49835269
##
import cv2
vidcap = cv2.VideoCapture('https://5d8c50e7b358f.streamlock.net/live/EVLAIM.stream/chunklist_w117438879.m3u8')
success,image = vidcap.read()
@TomerAdmon
TomerAdmon / test.html
Created November 1, 2020 19:23
Hello World Html
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
@TomerAdmon
TomerAdmon / test.md
Created November 1, 2020 19:22
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@TomerAdmon
TomerAdmon / sample.ps1
Created December 10, 2019 13:04
just a SP script
ipconfig