- <a rel="me" href="https://mstdn.social/@PhilomathJ">Mastodon</a>
- @PhilomathJ
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
| // Generic type to apply to every property modifying it as needed | |
| // In this case, we are making each property able to be undefined as well | |
| type AllowUndefined<T> = { [K in keyof T]: T[K] | undefined } | |
| // Initial interface | |
| interface Interface { | |
| a: number | |
| b: 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
| ; Ender 3 Custom End g-code | |
| M117 Completing printing sequence... ; Display message | |
| M400 ; Finish Moves | |
| G91 ; Set positioning to relative | |
| G1 E-2 F2700 ; Retract the filament | |
| G1 E-2 Z0.2 F2400 ; Retract the filament and raise Z-axis | |
| G1 X5 Y5 F3000 ; Wipe | |
| G1 Z10 ; Raise the Z-axis | |
| G90 ; Set positioning to absolute | |
| M106 S0 ; Turn-off fan |
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
| /** | |
| * Recursively returns the letter combination corresponding to the column for the given index | |
| * This is a more functional programming approach compared to the usual loop-based method | |
| * Tested to column index out to one decillion | |
| * @param {number} num Index to be converted | |
| * @returns {string} Letter combination as column indicator | |
| */ | |
| const columnIndexToLetter = (num: number): string => { | |
| return num <= 26 | |
| ? String.fromCharCode((num === 0 ? 26 : num) + 64) |
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 the index of the last used row within the designated column | |
| * @param {string} column Letter of the column to search | |
| * @param {number} stopRow Optional row to stop searching on. This helps if there is additional populated rows below which are not to be counted | |
| * @returns {number} Last populated row within the given range | |
| **/ | |
| function lastRowInCol(column: string, stopRow: number = 0): number { | |
| // Set lastRow to either the stopRow or the max row in the worksheet | |
| let lastRow: number = stopRow == 0 ? SpreadsheetApp.getActiveSheet().getMaxRows() : stopRow; | |