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:
import os | |
import re | |
import subprocess | |
import sys | |
# Regex to parse the diff hunk header, e.g. "@@ -12,5 +12,6 @@" | |
HUNK_HEADER_RE = re.compile(r'@@ -(\d+),?(\d+)? \+(\d+),?(\d+)? @@') | |
# Regex to find @ApiOperation(...) inside a line | |
API_OPERATION_RE = re.compile(r'@ApiOperation\s*\(\s*(.*)\s*\)') |
#!/bin/bash | |
# Repository name | |
REPO_NAME="my-repo-name" | |
# Get the date 2 years ago in UTC format | |
TWO_YEARS_AGO=$(date -v-2y -u +"%Y-%m-%dT%H:%M:%SZ") | |
# Retrieve and filter images older than 2 years | |
IMAGES_TO_DELETE=$(aws ecr describe-images \ |
// ==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== |
// ==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== |
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", |
{ | |
"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, |
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/ |
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:
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 |
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