Skip to content

Instantly share code, notes, and snippets.

@frankfullstack
frankfullstack / Angular - custom structural directives.md
Created June 14, 2023 16:15 — forked from JanMalch/Angular - custom structural directives.md
Writing your own structural directives with context variables

Writing your own structural directives with context variables

Complete code in math.directive.ts

After reading this you will be able to create a structural directive with inputs and context variables and use it like this:

<div *math="10; exponent: 3; let input; 
            let exponent = exponent; let r = root;
 let p = power; let ctrl = controller"&gt;
@frankfullstack
frankfullstack / api.test.ts
Created April 8, 2023 20:44 — forked from andrew8088/api.test.ts
Building your own custom jest matchers
import * as api from './api';
const TOKEN_REGEX = /^app-0.\d+$/;
expect.extend({
toBeValidSession(session: api.Session, userId: string, expectedTTL: number) {
const messages: string[] = [];
const validToken = TOKEN_REGEX.test(session.token);

Create a secrets file:

touch ~/.secret

Make sure it looks like this:

#!/bin/bash
@frankfullstack
frankfullstack / iterm2-solarized.md
Created April 18, 2021 18:29 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@frankfullstack
frankfullstack / README.md
Created January 16, 2018 10:08 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@frankfullstack
frankfullstack / git-feature-workflow.md
Created January 15, 2018 17:29 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

@frankfullstack
frankfullstack / introrx.md
Created January 19, 2017 22:12 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing