This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type CasingFormat = | |
| "lower case" | |
| "UPPER CASE" | |
| "Title Case" | |
| "camelCase" | |
| "PascalCase" | |
| "snake_case" | |
| "SCREAMING_SNAKE_CASE" | |
| "camel_Snake_Case" | |
| "Pascal_Snake_Case"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns a modified version of the input string, having collapsed all | |
* horizontal whitespace down to single space characters. | |
* | |
* @param input {string} The string that should be modified to have it's | |
* whitespaces collapsed. | |
* @returns {string} A modified version of the input string, having collapsed | |
* all horizontal whitespace down to single space characters. | |
*/ | |
export function collapseWhitespace(input: string): string { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Given a 2-dimensional array, this function returns a mapped 2-dimensional | |
* array wherein the rows of the input array have been 'grouped'. | |
* | |
* 'Grouping' involves merging similar rows of the input array. Rows are | |
* considered 'similar' if some subset of their fields are found to be | |
* equivalent to each other. This subset of fields is identified using the | |
* '$group_by' argument. 'Merging' involves the creation of an array of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns true if the input array appears to be an associative array, otherwise | |
* returning false. | |
* | |
* @param array $input The array being tested. | |
* @return bool true if the input array appears to be an associative array, | |
* otherwise returning false. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns an array of words extracted from the input string. | |
* | |
* @param string $text The input string from which to extract words. | |
* @return string[] An array of words extracted from the input string. | |
*/ | |
function convertToWords(string $text): array { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The full path at which to save the history file. | |
$history_file = "~\PowerShell\history.csv" | |
# The amount of history to save. | |
$history_size = 32KB | |
# Create the ~\PowerShell directory if is does not already exist. | |
if (!(Test-Path ~\PowerShell -PathType Container)) { | |
New-Item ~\PowerShell -ItemType Directory | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prompt { | |
$date = Get-Date -Format "M/d @ h:mm tt" | |
$cwp = Get-Location | |
$drive_letter = Split-Path -Path $cwp -Qualifier | |
$cwd = Split-Path -Path $cwp -Leaf | |
$location = $drive_letter + "\..\" + $cwd | |
if ($cwd -eq $cwp) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Created by Trevor Sears <[email protected]> (https://trevorsears.com/). | |
* 2:49 PM -- July 18th, 2022 | |
*/ | |
import fs from "fs"; | |
import process from "node:process"; | |
export type CheckFileOptions = { | |
isFile?: boolean, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE ExampleTable ( | |
`id` INT UNSIGNED NOT NULL | |
AUTO_INCREMENT | |
PRIMARY KEY | |
COMMENT 'An unsigned integer value that uniquely identifies this row among those in this table.', | |
`uuid` CHAR(36) NOT NULL | |
DEFAULT UUID() | |
COMMENT 'A UUID (''universally unique identifier'') that can uniquely identify this row in any context.', | |
`modifiedAt` DATETIME NOT NULL | |
DEFAULT CURRENT_TIMESTAMP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ssh-keygen -f "$HOME/.ssh/ids/$1-to-$2" -t "rsa-sha2-512" -C "Keyfile for: $3" |
NewerOlder