Skip to content

Instantly share code, notes, and snippets.

View brandonroberts's full-sized avatar

Brandon Roberts brandonroberts

View GitHub Profile
@0xernesto
0xernesto / auto-release-flow-bot.md
Last active August 28, 2025 12:28
How to set up an automated release flow using semantic-release and Github Actions.

Semantic Release bot flow

Overview

This semantic-release publishing flow consists of using a bot for publishing releases. Note that commits by this bot will not be signed/verfied. If this is a requirement for you, refer to this guide. This setup requires creating a Github App and adding the following Github Actions secrets to the repo it is being used in:

  • NPM_TOKEN
    • Refer to “Generating an NPM token” section.
  • MY_RELEASER_ID
  • Refer to “Creating a GitHub App” section
@lacolaco
lacolaco / 1.ngx-reactify.tsx
Last active September 15, 2025 04:33
A React component to render a standalone Angular component (Angular v14.2 is required)
import { ApplicationRef, ComponentRef, createComponent, Type } from "@angular/core";
import { createApplication } from "@angular/platform-browser";
import React, { useEffect, useRef, useState } from "react";
type AnyComponentRef = ComponentRef<unknown>;
export type ReactifyProps = {
component: Type<unknown>;
inputs?: Record<string, unknown>;
};
@zorji
zorji / auto-ts-ignore.ts
Last active June 16, 2025 12:32
A script to auto add // @ts-ignore to lines with TypeScript compilation error
/**
* A script to auto add // @ts-ignore to lines with TypeScript compilation error
* This could be useful when you are upgrading your tsc version, or introduced new changes in tsconfig or just converting JS codebase to TS.
* Example usage:
* $ npx tsc > compilation-errors.log
* $ npx ts-node auto-ts-ignore.ts compilation-errors.log
*/
import { readFile, writeFile } from 'fs/promises'
@laughinghan
laughinghan / Every possible TypeScript type.md
Last active June 22, 2025 15:21
Diagram of every possible TypeScript type

Hasse diagram of every possible TypeScript type

  • any: magic, ill-behaved type that acts like a combination of never (the proper [bottom type]) and unknown (the proper [top type])
    • Anything except never is assignable to any, and any is assignable to anything at all.
    • Identities: any & AnyTypeExpression = any, any | AnyTypeExpression = any
    • Key TypeScript feature that allows for [gradual typing].
  • unknown: proper, well-behaved [top type]
    • Anything at all is assignable to unknown. unknown is only assignable to itself (unknown) and any.
    • Identities: unknown & AnyTypeExpression = AnyTypeExpression, unknown | AnyTypeExpression = unknown
  • Prefer over any whenever possible. Anywhere in well-typed code you're tempted to use any, you probably want unknown.

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
@brandonroberts
brandonroberts / .bash_aliases
Last active November 28, 2019 02:47
Git Aliases
alias gch='git checkout'
alias gcb='git checkout -b'
alias gcm='git checkout master'
alias greb='git rebase'
alias grbm='git rebase master'
alias grbc='git rebase --continue'
alias gpl='git pull --ff'
alias gbr='git branch'
alias gpo='git push origin'
alias gdff='git diff'
@brandonroberts
brandonroberts / chromebook.sh
Last active November 27, 2019 02:50
Chromebook Scripts
# deps
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install nano git-core build-essential chromium
# git config
git config --global user.name "Brandon"
git config --global user.email "[email protected]"
# ssh
ssh-keygen -t rsa -b 4096 -C "[email protected]"
@cassiozen
cassiozen / pixelbook-dev-setup.md
Last active October 22, 2023 12:06 — forked from denolfe/pixelbook-linux-setup.md
Notes on setting up Pixelbook for development

Pixelbook Setup

Change your channel

Some of the features mentioned in this document only work on the beta or Dev channel. To change your channel:

  1. chrome://help in a browser window
  2. Click Detailed Build Information
  3. Change Channel
  4. Select Beta (Or Dev, if you're feeling adventurous)
@btroncone
btroncone / rxjs_operators_by_example.md
Last active September 14, 2025 16:48
RxJS 5 Operators By Example
@btroncone
btroncone / ngrxintro.md
Last active September 5, 2025 05:30
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents