Skip to content

Instantly share code, notes, and snippets.

View jperl's full-sized avatar

Jon Perl jperl

View GitHub Profile
@sahajamit
sahajamit / AutomationFrameworkMigrationPrompt.md
Last active March 24, 2025 16:26
AutomationFrameworkMigrationPrompt.md

Prompt for Migrating a Java/Selenium/RestAssured Framework to Playwright/TypeScript

I have a Java-based automation framework using Selenium for UI testing and RestAssured for API testing. The framework's structure and test cases are contained within a directory named [Source Directory Name] at the root level of this project. Please migrate this entire framework to use Playwright with TypeScript for both UI and API testing. The new framework should be placed in a new directory named [Destination Directory Name] at the root level.

The current framework includes:

  • UI Tests: Implemented using Selenium, likely with a Page Object Model (POM) or similar design pattern. These tests cover various user interactions with the web application.
  • API Tests: Implemented using RestAssured, covering the testing of RESTful APIs. These tests verify API functionality, data integrity, and response codes.
  • Test Framework: Likely using JUnit or TestNG for test execution, reporting, and assertion.
@jdmichaud
jdmichaud / Compressed UDP feed
Last active July 28, 2022 16:47
Create a virtual monitor and stream it
# Transmit a x264 compressed low latency feed using udp
server: gst-launch-1.0 videotestsrc is-live=true ! videoconvert ! x264enc speed-preset=ultrafast tune=zerolatency byte-stream=true threads=1 key-int-max=15 intra-refresh=true ! rtph264pay ! udpsink host=%d port=9002
client: gst-launch-1.0 udpsrc port=9002 caps='application/x-rtp' ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false async=false
@notakaos
notakaos / create_function_plv8_cuid.sql
Last active August 16, 2024 10:10
cuid for PostgreSQL with PL/v8
-- original code: https://github.com/ericelliott/cuid
-- Add the "plv8" extension
create extension if not exists "plv8";
-- Add the "pgcrypto" extension
create extension if not exists "pgcrypto";
\dx
-- Connect a database
@Dref360
Dref360 / coordconv2d.py
Last active February 11, 2020 14:40
Un-scaled version of CoordConv2D
import keras.backend as K
import tensorflow as tf
from tensorflow.keras.layers import Layer
"""Not tested, I'll play around with GANs soon with it."""
from tensorflow.keras.layers import Conv2D
import numpy as np
class CoordConv2D(Layer):
@sseveran
sseveran / ray_tune_reporter_hook.py
Created June 15, 2018 15:42
A Tensorflow hook for reporting state to ray-tune
import six
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.training import training_util
from tensorflow.python.training.session_run_hook import SessionRunArgs
class RayTuneReportingHook(tf.train.SessionRunHook):
def __init__(self, params, reporter):
self.reporter = reporter
@hlzz
hlzz / gist:ba6da6e692beceb4da8b4d5387a8eacc
Created February 28, 2018 09:03
Generate sprite images for tensorboard
#!/usr/bin/python
from PIL import Image
import math
test_image_list = '/home/tianwei/Data/sfm_data/test_image_list' # path to the image list
with open(test_image_list, 'r') as f:
test_images = f.readlines()
test_images = map(str.strip, test_images)
@datlife
datlife / mnist_tfdata.py
Last active May 24, 2023 02:03
Training Keras model with tf.data
"""An example of how to use tf.Dataset in Keras Model"""
import tensorflow as tf # only work from tensorflow==1.9.0-rc1 and after
_EPOCHS = 5
_NUM_CLASSES = 10
_BATCH_SIZE = 128
def training_pipeline():
# #############
# Load Dataset
@peterroelants
peterroelants / mnist_estimator.py
Last active February 14, 2024 11:26
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.3"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
from tensorflow.contrib.learn import ModeKeys
from tensorflow.contrib.learn import learn_runner
# Show debugging output
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active April 17, 2025 05:37
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@mjdietzx
mjdietzx / residual_network.py
Last active March 26, 2024 06:33
Clean and simple Keras implementation of residual networks (ResNeXt and ResNet) accompanying accompanying Deep Residual Learning: https://blog.waya.ai/deep-residual-learning-9610bb62c355.
"""
Clean and simple Keras implementation of network architectures described in:
- (ResNet-50) [Deep Residual Learning for Image Recognition](https://arxiv.org/pdf/1512.03385.pdf).
- (ResNeXt-50 32x4d) [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/pdf/1611.05431.pdf).
Python 3.
"""
from keras import layers
from keras import models