Skip to content

Instantly share code, notes, and snippets.

setting up a fresh mac to a full dev station

this is a personal gist, a list of steps to take in order to bring a fresh copy of macOS to meet the minimum requirements of a fully intergrated development machine. if you came across this file, please feel free to take these configuration steps, comment and, suggest improvments and updates. note that these configurations are highly opinionated and they were wrriten in order to fit specific needs.

step 1: install google chrome

as of today, safari is unexeptable for a web developer,

@angrygorilla
angrygorilla / migrate-git-repos.md
Created June 7, 2022 17:42 — forked from dbirks/migrate-git-repos.md
Script to fully migrate git repos, including all tags and branches

Migrate git repos script

I used this for migrating git repos from Bitbucket to Github. It uses git's --mirror flag for cloning and pushing to also transfer all tags and branches.

It would be helpful to have SSH keys set up on both ends. Then all you should have to do is to make sure the hardcoded orgname is set to the appropriate one for both the source and destination.

Once I migrated repos, I used this to replace my origin url locally (assumes using ssh):

sed -i s/bitbucket.org:orgname/github.com:orgname/g .git/config
@angrygorilla
angrygorilla / ainput.py
Created May 3, 2022 22:37 — forked from delivrance/ainput.py
Python async input
import asyncio
from concurrent.futures import ThreadPoolExecutor
async def ainput(prompt: str = "") -> str:
with ThreadPoolExecutor(1, "AsyncInput") as executor:
return await asyncio.get_event_loop().run_in_executor(executor, input, prompt)
async def main():
@angrygorilla
angrygorilla / 00.md
Created December 30, 2021 03:29 — forked from maxivak/00.md
Selenium tests on Ruby

Selenium tests on Ruby

Install

gems:

  • gem 'capybara', '2.10.1'
  • gem 'selenium-webdriver', '3.0.3'

Selenium

@angrygorilla
angrygorilla / flocking.md
Created August 12, 2021 19:38 — forked from marcdel/flocking.md
Notes about the flocking refactoring strategy from 99 Bottles of OOP

Flocking

Rules

  1. Select the things that are most alike.
  2. Find the smallest difference between them.
  3. Make the simplest change that will remove that difference.

Steps

  1. Parse the new code. (e.g. else clause based on a boolean that is always false)
  2. Parse and execute the new code. (e.g. else clause based on a boolean that is passed in as a parameter)
@angrygorilla
angrygorilla / Makefile
Created August 12, 2021 03:10 — forked from istepanov/Makefile
Makefile for deploying Python 3 AWS Lambda
PROJECT = myProject
FUNCTION = $(PROJECT)
REGION = us-west-1
ENVCHAIN = my-aws-env
all: build
.PHONY: clean build deploy
clean:

Electron is tricky to get set up on Windows Subsystem for Linux, but it can work!

Four things needed overall:

  1. you need WSL2, not WSL1
  2. you need node, of course, and that part isn't so bad
  3. you need to apt install several dependencies
  4. you need an X Server so it can display the electron GUI over in Windows-land

Setup instructions, in order:

@angrygorilla
angrygorilla / gen_http_cont_md5.rb
Created May 12, 2021 18:35 — forked from rob-murray/gen_http_cont_md5.rb
Generate a base64 encoded md5 hash of a file in Ruby for use in http Content-MD5 header
require 'digest'
def main
raise ArgumentError, 'Please specify a file to work with' unless ARGV.length == 1
file_path = ARGV[0]
digest = Digest::MD5.base64digest(File.read( file_path ))
puts "The MD5 digest base64 encoded MD5 is #{digest} of file #{file_path}."
@angrygorilla
angrygorilla / model.template.txt
Created April 12, 2021 23:15 — forked from joshuapinter/model.template.txt
Rails Model Template
class [Your Class Here] < ActiveRecord::Base
##################################################################################################
### Attributes ###################################################################################
##################################################################################################
### Constants ####################################################################################
@angrygorilla
angrygorilla / rbenv-howto.md
Created February 16, 2021 23:23 — forked from MicahElliott/rbenv-howto.md
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev