Skip to content

Instantly share code, notes, and snippets.

View mikeatlas's full-sized avatar
💻

Mike Atlas mikeatlas

💻
View GitHub Profile
@mikeatlas
mikeatlas / console-log-format-timestamps.js
Created September 8, 2016 20:11
Overrides the console.log (specifically this is for node.js) with an ISO timestamp prefix and still handles string interpolation formats.
function showDate(){
var date = new Date(), str = date.toISOString();
return str;
}
function formatArgs(args){
return util.format.apply(util.format, Array.prototype.slice.call(args));
}
var origLog = console.log;
console.log = function() {
var strDate = " [ " + showDate() + " ] ";
@mikeatlas
mikeatlas / .golang-example-gitlab-ci.yml
Last active February 2, 2024 08:08
Example Go GitLab CI setup (no root/sudo required)
# See docs/examples
# http://doc.gitlab.com/ce/ci/quick_start/README.html
# http://doc.gitlab.com/ce/ci/yaml/README.html
# GitLab CI template for Go tests. Note this installs
# a new working copy of Go in a non-standard path such
# that sudo/root is not needed for the install stage.
# note that this particular install-environment stage
# is overly verbose in order to debug anything tricky
@mikeatlas
mikeatlas / readme.md
Created March 21, 2018 22:10
maxfiles ulimit on macos
@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 / postgres_array.go
Created February 28, 2018 17:00 — forked from adharris/postgres_array.go
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@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 / 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 / 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 / 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 / new_invitation.html.erb
Last active April 17, 2022 19:36
How to invite users in active admin with devise_invitable
<!-- /app/views/admin/users/new_invitiations.html.erb -->
<h2>Send invitation</h2>
<%= form_for @user, :url => send_invitation_admin_users_path do |f| %>
<table style='width: 50%'>
<tr>
<td><%= f.label :first_name %></td>
<td><%= f.text_field :first_name %></td>