Skip to content

Instantly share code, notes, and snippets.

View ctrlShiftBryan's full-sized avatar

Bryan Arendt ctrlShiftBryan

View GitHub Profile
@ctrlShiftBryan
ctrlShiftBryan / asd
Created August 13, 2021 10:42
Created from Remix Form!
asd
@ctrlShiftBryan
ctrlShiftBryan / Phoenix_Create_React_App.md
Last active August 2, 2021 02:04
Phoenix and a traditional front end.

I’m using it with a phoenix backend and a create react app front-end.

This requires building the assets and copying to the priv/static folder. Phoenix acts as a giant file server and then I also use it as an api with graphql absinthe.

Building assets

I make copying to the priv/static folder part of my asset build process package.json build script

    “build”: “rescripts build”,
    “postbuild”: “mkdirp ../priv/static && cpx \“./build/**\” \“../priv/static\” --clean && cpx \“src/styles/tailwind.css\” \“../priv/static\” “,
@ctrlShiftBryan
ctrlShiftBryan / absynth.ex
Created November 5, 2020 12:53
elixir absinth string key map middle ware
# We are changing absithe here so that it expects maps with string keys instead
# of maps with atom keys when it resolves :user object
#
# Out of the box absinthe is optimized for using with something like ecto
# that would normally use an ecto schema (which have atom keys).
# Instead we are working with api responses and we don't need
# the overhead converting our maps to maps with atom keys.
def middleware(
middleware,
%{identifier: identifier} = field,
@ctrlShiftBryan
ctrlShiftBryan / HowToPaveAMachine.md
Last active November 13, 2022 00:58
How To Prevision OSX
  1. Chrome
  2. VSCode
  1. enable desktop spaces shortcut
  • System Preferences -> Keyboard -> Shortcuts -> Mission Control
  • Move left a space ctrl+shift+h
  • Move right a space ctrl+shift+l
  1. install cascadia code font
require 'digest/md5'
Digest::MD5.hexdigest(File.read('Gemfile.lock'))
@ctrlShiftBryan
ctrlShiftBryan / regex.md
Last active October 29, 2018 01:59
REGEX for SQL DDL
\]\ \[varchar\].+\ (NULL|NOT NULL),
\] \[datetime\].+,
@ctrlShiftBryan
ctrlShiftBryan / how_to.sh
Created June 5, 2018 14:51
Curl Chromedriver
curl -XPOST http://localhost:9515/session -d '{"desiredCapabilities":{"browserName":"chrome", "chromeOptions":{"args":["--headless"]}}}'
@ctrlShiftBryan
ctrlShiftBryan / expose.ex
Created February 26, 2018 15:04
expose private functions in elixir for tests
@compile if Mix.env == :test, do: :export_all
$('.venue:eq(15)').click()
@ctrlShiftBryan
ctrlShiftBryan / how_to.md
Last active January 21, 2018 13:59
resize .dmg

sudo dd if=/dev/sdb of=./sdb.raw VBoxManage convertdd sdb.raw sdb.vdi --format VDI

VBoxManage modifyhd --resize 30000 ~/Documents/VM/Windows10.vdi VBoxManage showhdinfo ~/path/to/vmdrive.vdi

Gparted right Click both sd2 and sd5 and chose "Deactivate". resize the extended (sda2) partition. resize the lvm (sda5) partition.