Skip to content

Instantly share code, notes, and snippets.

View tommydunn's full-sized avatar
🖖

Tommy Dunn tommydunn

🖖
View GitHub Profile
@tommydunn
tommydunn / set-git-to-use-ssh.sh
Created August 26, 2025 19:02
Set git to use git:// instead of https://
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@stephancasas
stephancasas / sonoma-text-insertion-point-downgrade.jxa.js
Created October 7, 2023 02:58
Disable Sonoma Text Insertion Point ("Cursor" / "Caret")
#!/usr/bin/env osascript -l JavaScript
const App = Application.currentApplication();
App.includeStandardAdditions = true;
const kCFPrefsFeatureFlagsDir = '/Library/Preferences/FeatureFlags/Domain';
const kCFPrefsFeatureEnabledKey = 'Enabled';
const kUIKitDomainPrefsTemporaryPath = '/tmp/UIKit.plist';
const kUIKitRedesignedTextCursorKey = 'redesigned_text_cursor';
∇ app
∇ core
∇ guards
auth.guard.ts
module-import.guard.ts
no-auth.guard.ts
∇ interceptor
token.interceptor.ts
error.interceptor.ts
∇ services
@jagdeepsingh
jagdeepsingh / SETUP.md
Last active June 5, 2024 05:20
Set up macOS Big Sur 11.2 with development tools | Git | Homebrew | rbenv | ruby | Atom | PostgreSQL | mongodb

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';
∇ app
∇ core
∇ guards
auth.guard.ts
module-import.guard.ts
no-auth.guard.ts
∇ interceptor
token.interceptor.ts
error.interceptor.ts
∇ services
@blacksaildivision
blacksaildivision / wp-head-clean.php
Last active September 11, 2024 15:11
Remove all unnecessary stuff from WordPress <head> tag
<?php
/**
* Alter dns-prefetch links in <head>
*/
add_filter('wp_resource_hints', function (array $urls, string $relation): array {
// If the relation is different than dns-prefetch, leave the URLs intact
if ($relation !== 'dns-prefetch') {
return $urls;
}
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active November 25, 2025 13:21
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


title: rbenv category: Ruby layout: 2017/sheet updated: 2017-10-11 weight: -1 description: | A one-page guide to rbenv Ruby version manager, with usage examples and more. intro: | rbenv lets you manage installations of multiple Ruby versions.

// Put this file in Program Files\Adobe\Photoshop\Presets\Scripts\
// In PhotoShop menu File > Scripts > Layers To Sprite Sheet
// Arrange layers into a sprite sheet.
if (documents.length > 0) {
var docRef = activeDocument;
var numLayers = docRef.artLayers.length;
var cols = docRef.width;