Skip to content

Instantly share code, notes, and snippets.

View tommydunn's full-sized avatar
🖖

Tommy Dunn tommydunn

🖖
View GitHub Profile
@tommydunn
tommydunn / slugify.pipe.ts
Created April 12, 2023 21:05 — forked from djabif/slugify.pipe.ts
Angular Pipe to transform a string into a slug
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'slugify'})
export class SlugifyPipe implements PipeTransform {
transform(input: string): string {
return input.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
∇ app
∇ core
∇ guards
auth.guard.ts
module-import.guard.ts
no-auth.guard.ts
∇ interceptor
token.interceptor.ts
error.interceptor.ts
∇ services
@tommydunn
tommydunn / semantic-commit-messages.md
Created November 15, 2022 10:54 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@tommydunn
tommydunn / mysql_cheat_sheet.md
Created September 22, 2021 15:29 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@tommydunn
tommydunn / SETUP.md
Created September 22, 2021 15:28 — forked from jagdeepsingh/SETUP.md
Set up macOS Big Sur 11.2 with development tools | Git | Homebrew | rbenv | ruby | Atom | PostgreSQL | mongodb
@tommydunn
tommydunn / change.js
Created September 22, 2021 03:10 — forked from DmitriyRF/change.js
Remove or don't redirect “thank you” page Mailchimp
/* To use this example:
1. Download this html file
2. Replace the form action url with your own from the MailChimp supplied embed code
3. Within the action url, replace "subscribe/post" with "subscribe/post-json"
4. Be sure the action url starts with http://. If it doesn't, the form will hang when testing the html as a local file in your browser.
5. Open this file in a browser on your local machine
*/

Generate guard

ng g guard guards/auth
  -> select "canActivate"

auth.guard.ts

import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
@tommydunn
tommydunn / converter.php
Created March 22, 2021 02:13 — forked from ChrisButterworth/converter.php
Webp converter for WordPress
<?php
namespace Converter;
use WebPConvert\WebPConvert;
class Converter
{
public $lazy = false;
public function __construct($lazy = false)
@tommydunn
tommydunn / ttf2woff2.md
Created January 8, 2021 17:07 — forked from sergejmueller/ttf2woff2.md
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable