Skip to content

Instantly share code, notes, and snippets.

View ctrlShiftBryan's full-sized avatar

Bryan Arendt ctrlShiftBryan

View GitHub Profile
@ctrlShiftBryan
ctrlShiftBryan / react-native-starters.md
Created January 4, 2024 12:37
react-native-starter

create-expo-app

create-expo-stack

create-react-native-app

create-solito-app

create-t3-turbo

import { createClient, RedisClientType, RedisModules, RedisScripts } from '@node-redis/client';
import { getFromCache } from './cache.server';
describe('Name of the group', () => {
let client : RedisClientType<RedisModules, RedisScripts>;
beforeAll(async () => {
client = createClient({ url: process.env.REDIS_URL });
await client.connect();
});
@ctrlShiftBryan
ctrlShiftBryan / test.js
Created February 16, 2022 18:04
test.js
class Game {
score(scores) {
// put your code here
}
}
describe(‘Game’, () => {
const subject = new Game();
test(‘when no special scores occur’, () => {
@ctrlShiftBryan
ctrlShiftBryan / asd
Created August 13, 2021 10:48
Created from Remix Form!
asd
@ctrlShiftBryan
ctrlShiftBryan / asdasdasd
Created August 13, 2021 10:47
Created from Remix Form!
asdasdasd
@ctrlShiftBryan
ctrlShiftBryan / test
Created August 13, 2021 10:46
Created from Remix Form!
test
@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