Skip to content

Instantly share code, notes, and snippets.

View mikeatlas's full-sized avatar
💻

Mike Atlas mikeatlas

💻
View GitHub Profile
@mikeatlas
mikeatlas / userscript.js
Created September 5, 2023 20:05
Tampermonkey userscript: AWS SSO - Close 'Get Credentials' Modal
// ==UserScript==
// @name AWS SSO - Close 'Get Credentials' Modal
// @namespace awsapps.com
// @version 1.0
// @description Allow escape key to close modal
// @author Mike Atlas
// @match https://*.awsapps.com/start*
// @icon https://www.google.com/s2/favicons?sz=64&domain=awsapps.com
// ==/UserScript==
@mikeatlas
mikeatlas / closeCredentialsModalAWSSSO.js
Created May 2, 2023 19:04
Tampermonkey script for the AWS SSO login page. Allows keyboard escape key to close the "Get Credentials" modal.
// ==UserScript==
// @name AWS SSO - Close 'Get Credentials' Modal
// @namespace awsapps.com
// @version 1.0
// @description Allow escape key to close modal
// @author Mike Atlas
// @match https://*.awsapps.com/start*
// @icon https://www.google.com/s2/favicons?sz=64&domain=awsapps.com
// ==/UserScript==
@mikeatlas
mikeatlas / ecs-task.tf
Created April 3, 2023 21:00
terraform template for applying a task
resource "aws_ecs_task_definition" "user_code_task_def" {
family = local.user_code_family
container_definitions = jsonencode([
{
"name" : "${local.user_code_family}",
"image" : "${local.ecr_repo_image_path}:${local.latest_user_code_tag}",
"portMappings" : [
{
"hostPort" : 8001,
"protocol" : "tcp",
@mikeatlas
mikeatlas / example task definition for user code dagster.json
Last active April 3, 2023 21:19
pardon some of the mix of underscores and dashes, they may not be consistent... redacting internal values quickly
{
"taskDefinitionArn": "arn:aws:ecs:us-east-1:0123456789:task-definition/user_code:155",
"containerDefinitions": [
{
"name": "user-code-task",
"image": "0123456789.dkr.ecr.us-east-1.amazonaws.com/user_code:build-v1.124",
"cpu": 0,
"portMappings": [
{
"containerPort": 8001,
@mikeatlas
mikeatlas / Dockerfile
Last active March 24, 2023 15:47
"user code" / biz logic service for Dagster. All jobs/graphs/ops/etc live in the user_code directory
FROM python:3.10-slim-bullseye as dagster
RUN apt-get update && apt-get upgrade -yqq
ENV DAGSTER_HOME=/opt/dagster/dagster_home
RUN mkdir -p $DAGSTER_HOME/user_code
WORKDIR $DAGSTER_HOME
COPY dagster.yaml workspace.yaml $DAGSTER_HOME/
@mikeatlas
mikeatlas / split-csv.md
Last active April 1, 2022 20:31
some bash shell timesaver for splitting up csv
function split-csv() { 
  fn=${1:0:-4}; 
  fe=${1: -4}; 
  split -d -n $2 ${fn}${fe} ${fn}__part_; 
  for f in ${fn}__part*; do mv $f ${f}${fe}; done; 
};

Usage:

@mikeatlas
mikeatlas / fix-libv8-mac.txt
Created October 20, 2020 15:02 — forked from fernandoaleman/fix-libv8-mac.txt
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-319
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-319
bundle install
@mikeatlas
mikeatlas / README.md
Created February 24, 2020 22:15 — forked from mosra/README.md
Git pre-push hook to confirm pushing to master

Git pre-push hook

Checks if the remote branch is master, then asks a confirmation. Based on https://gist.github.com/ColCh/9d48693276aac50cac37a9fce23f9bda, but modified to check the remote name instead of local, making it work also for the really dangerous accidents like below:

git push -f origin e09b7418a310114f6aaf495f969c3859095a99af:master

Further info: https://dev.ghost.org/prevent-master-push/, https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook, https://git-scm.com/docs/githooks#_pre_push, https://stackoverflow.com/questions/22585091/git-hooks-pre-push-script-does-not-receive-input-via-stdin

@mikeatlas
mikeatlas / board.go
Last active December 20, 2019 00:51
some kind of board game like reversi/othello but with colors?
package main
import "fmt"
func main() {
initialBoard := [][]int{
[]int{1, 1, 1, 4},
[]int{1, 1, 2, 4},
[]int{2, 1, 2, 4},
@mikeatlas
mikeatlas / settings.json
Last active May 7, 2018 15:23
my vscode user settings
{
"window.zoomLevel": -1,
"files.associations": {
"*.peg": "pegjs"
},
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": false,
"suppressCommitNotFoundWarning": false,
"suppressFileNotUnderSourceControlWarning": false,
"suppressGitVersionWarning": false,