Skip to content

Instantly share code, notes, and snippets.

Avatar

George Pantazes gwpantazes

View GitHub Profile
@gwpantazes
gwpantazes / gist:a21a6d75ca14e347abb4f118adcfdc52
Created Sep 30, 2020 — forked from samnang/gist:1759336
Install Bash version 4 on MacOS X
View gist:a21a6d75ca14e347abb4f118adcfdc52
# Install Bash 4 using homebrew
brew install bash
# Or build it from source...
curl -O http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz
tar xzf bash-4.2.tar.gz
cd bash-4.2
./configure --prefix=/usr/local/bin && make && sudo make install
# Add the new shell to the list of legit shells
@gwpantazes
gwpantazes / getTypedStringEnumArray.ts
Last active Sep 9, 2020
Function to get typesafe Typescript enum member array
View getTypedStringEnumArray.ts
export function getTypesafeEnumArray<T>(enumType: T): T[keyof T][] {
return Object.keys(enumType)
.filter((key) => isNaN(Number(enumType[key as keyof typeof enumType])))
.map((key) => enumType[key as keyof typeof enumType]);
}
enum OrdinalEnum {
ONE,
TWO
}
@gwpantazes
gwpantazes / Incremental Steps to Running a Docker R Project.md
Last active Jun 26, 2020
Incremental Steps to Running a Docker R Project
View Incremental Steps to Running a Docker R Project.md

Incremental Steps to Running a Docker R Project

This guide shows an incremental approach to running a full R project with docker, from docker installation to creating your own containerized R project.

About Docker

This guide isn't going to go in-depth on how Docker works. We'll only cover necessary concepts if it's relevant at a particular step. To learn more about Docker, see the Docker Getting Started Overview.

Diagram of Docker Overview

View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@gwpantazes
gwpantazes / MyStepDefs.java
Created Sep 12, 2019
Cucumber Scenario Outline and custom configured ParameterType aren't compatible for step highlighting/usage detection
View MyStepDefs.java
package com.example.test;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class MyStepdefs {
@Given("that we're using a scenario outline")
@gwpantazes
gwpantazes / SafariBugWorkaround.java
Last active Apr 14, 2021
SafariDriver can't clear cookies
View SafariBugWorkaround.java
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.safari.SafariDriver;
class SafariBugWorkaround {
/**
* Delete all the cookies for the current domain.
*
* <p>Should be used in-place of {@link WebDriver.Options#deleteAllCookies()} until <a
* href="">this {@code SafariDriver} bug</a> is fixed.
@gwpantazes
gwpantazes / # python - 2019-06-25_13-09-58.txt
Created Jun 25, 2019
python on macOS 10.14.5 - Homebrew build logs
View # python - 2019-06-25_13-09-58.txt
Homebrew build logs for python on macOS 10.14.5
Build date: 2019-06-25 13:09:58
@gwpantazes
gwpantazes / check-venv.sh
Created Jun 25, 2019
Check if you are in a Python Virtual Environment
View check-venv.sh
# 100% surefire way to detect a virtual environment: Check for the real_prefix system attribute.
echo $(python <<EOF
import sys
if(hasattr(sys, 'real_prefix')):
print("Yes, you are in a virtual environment. (" + getattr(sys, 'real_prefix') + ")")
else:
print("No, you are not in a virtual environment.")
EOF
)
@gwpantazes
gwpantazes / SeleniumDriverUserAgentConfigurations.java
Last active Jun 6, 2019
Setting Selenium WebDriver useragents
View SeleniumDriverUserAgentConfigurations.java
import io.github.bonigarcia.wdm.WebDriverManager;
import java.io.IOException;
import java.util.Map;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
/*
@gwpantazes
gwpantazes / .bash_profile
Last active Jun 5, 2020
.bash_profile Java/jenv configuration which sets JAVA_HOME dynamically from jenv
View .bash_profile
# Java Configuration: jenv, JAVA_HOME, utilities and aliases, etc...
DEFAULT_JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home"
if which jenv > /dev/null
then
export JENV_ROOT="$HOME/.jenv"
export PATH="$JENV_ROOT/bin:$PATH"
# Enable shims and autocompletion.
# WARNING jenv init wipes out any previously set JAVA_HOME variable.
eval "$(jenv init -)"