Skip to content

Instantly share code, notes, and snippets.

View robertcoopercode's full-sized avatar

Robert Cooper robertcoopercode

View GitHub Profile
@robertcoopercode
robertcoopercode / .zshrc
Last active March 31, 2024 01:08
Zsh configuration file
#------------------
# Shell Variables
#------------------
# Specify VS Code as default editor for the React Native Simulator
export REACT_EDITOR=code-insiders
# Set VS Code Insiders as default code editor
export EDITOR=code-insiders
# Android SDK
export ANDROID_HOME=~/Library/Android/sdk
@robertcoopercode
robertcoopercode / dark_colors.yaml
Created February 17, 2019 04:13
Color LS custom color configuration file
# Main Colors
unrecognized_file: palegreen
recognized_file: turquoise
dir: dodgerblue
# Link
dead_link: red
link: cyan
# Access Modes
@robertcoopercode
robertcoopercode / .hyper.js
Last active June 20, 2023 19:49
Hyper Configuration
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',
<?php
/**
* Lorem Ipsum Generator
*
* PHP version 5.3+
*
* Licensed under The MIT License.
* Redistribution of these files must retain the above copyright notice.
*
@robertcoopercode
robertcoopercode / loremipsum.php
Last active June 20, 2022 10:36
Raycast script for lorem ipsum text. Related utils file found at https://gist.github.com/robertcoopercode/e9ed269fdbffe63a440e98cf8575779b
#!/usr/bin/env php
# Dependency: This script requires PHP
# Install PHP: https://www.php.net/manual/en/install.php
#
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Lorem Ipsum
# @raycast.mode compact
# @raycast.packageName Lorem Ipsum
const fillArray = <ArrayElementType>(len: number, elem: ArrayElementType) => {
return new Array<ArrayElementType>(len).fill(elem);
};
const newArray = fillArray<string>(3, 'hi'); // => ['hi', 'hi', 'hi']
newArray.push('bye'); // ✅
newArray.push(true); // ❌ - only strings can be added to the array
enum ThemeColors {
Primary = 'primary',
Secondary = 'secondary',
Dark = 'dark',
DarkSecondary = 'darkSecondary',
};
# NPM Installation Method
npm install --global typescript # Global installation
npm install --save-dev typescript # Local installation
# Yarn Installation Method
yarn global add typescript # Global installation
yarn add --dev typescript # Local installation
// Default function parameters
const tweetLength = (message = 'A default tweet') => {
return message.length;
}
// Optional function parameter
function callMom(message?: string) {
if (!message) {
console.log('Hi mom. Love you. Bye.');
} else {
console.log(message);
}
}
// Interface describing an object containing an optional property