This file contains 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
require "rails_helper" | |
# https://mvaragnat.medium.com/rails-6-and-rspec-how-to-test-zeitwerk-mode-81782b6d3388 | |
describe "Zeitwerk" do | |
it "eager loads all files" do | |
# like running `bin/rails zeitwerk:check` | |
expect { Zeitwerk::Loader.eager_load_all }.not_to raise_error | |
end | |
end |
This file contains 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
// loadAppEnv.js | |
const fs = require('fs') | |
const dotenvFlow = require('dotenv-flow') | |
// This module loads .env files from the config/ directory based the "app | |
// environment" that it is being built for or is running in (e.g. development, | |
// preview, staging, beta, canary, production, etc..). The "app environment" | |
// is determined by APP_ENV (if defined) or NODE_ENV. It exports a set of | |
// environment variables which should be passed to Next.js as the env config. | |
// |
This file contains 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 to create a new Heroku app instance using the ruby Heroku Platform API | |
# | |
# Documentation: | |
# https://devcenter.heroku.com/articles/setting-up-apps-using-the-heroku-platform-api | |
# https://devcenter.heroku.com/articles/platform-api-reference#app-setup | |
# https://github.com/heroku/platform-api | |
# https://heroku.github.io/platform-api | |
# | |
# Add the gem 'platform-api' | |
require "platform-api" |
This file contains 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 to open text from stardard-input in Preview | |
## inspired by the `man-preview` function of Oh My Zsh that opens any man page in Preview https://github.com/ohmyzsh/ohmyzsh/blob/b60b3f184275c39800dd7284d6904fcf295b3956/plugins/macos/macos.plugin.zsh#L221 | |
## requires enscript: `brew install enscript` | |
## example usage: | |
## echo "hello world" | txt-preview | |
function txt-preview() { | |
enscript -q -B -p- | open -f -a Preview | |
} |
This file contains 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
// utility type that treats an object as "unknown but might be of type T" | |
// allows you to access each property that T has but assumes the value is `unknown | undefined` | |
// this lets you test the values of each property to determine if it is in fact a T | |
// autocomplete and refactoring the property names work | |
// you get a compiler error if you try to access a property not in T | |
type UnknownMaybe<T> = { | |
[P in keyof T]?: T[P] extends object ? UnknownMaybe<T[P]> : unknown | |
} | |
interface Message { |
This file contains 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
# add to your shell startup file (e.g. ~/.zshrc or ~/.bash_profile) | |
export FOCUS_IGNORE_SITES="twitter.com api.twitter.com www.facebook.com www.nytimes.com" | |
alias focus='sudo echo "127.0.0.1 ${FOCUS_IGNORE_SITES} # FOCUS_IGNORE_SITES" | sudo tee -a /etc/hosts > /dev/null' | |
alias unfocus="sudo sed -i '' '/FOCUS_IGNORE_SITES/d' /etc/hosts" |
This file contains 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
/remind #general "Team meeting starts in 15 minutes https://meet.google.com/XXXXXXX" at 10:45AM every Monday | |
/remind #general "Team meeting starts in 5 minutes https://meet.google.com/XXXXXXX" at 10:55AM every Monday | |
/remind #general "Team meeting starts in 1 minute https://meet.google.com/XXXXXXX" at 10:59AM every Monday |
This file contains 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
protocol MyProtocol { | |
var name: String? { get } | |
} | |
extension MyProtocol { | |
var name: String? { | |
return "aDefaultName" | |
} | |
} |
This file contains 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/sh | |
convert Icon-1024.png -resize 20x20 Icon-20.png | |
convert Icon-1024.png -resize 40x40 Icon-20@2x.png | |
convert Icon-1024.png -resize 60x60 Icon-20@3x.png | |
convert Icon-1024.png -resize 29x29 Icon-29.png | |
convert Icon-1024.png -resize 58x58 Icon-29@2x.png | |
convert Icon-1024.png -resize 87x87 Icon-29@3x.png | |
convert Icon-1024.png -resize 40x40 Icon-40.png | |
convert Icon-1024.png -resize 80x80 Icon-40@2x.png | |
convert Icon-1024.png -resize 76x76 Icon-76.png |
This file contains 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/sh | |
## Disable AppTransportSecurity in DEBUG Simulator Builds | |
if [[ ${CONFIGURATION} == "Debug" ]] && [[ $PLATFORM_NAME == *"simulator"* ]]; then | |
TARGET_INFOPLIST="${CONFIGURATION_BUILD_DIR}/${INFOPLIST_PATH}" | |
## Delete NSAppTransportSecurity entry if it already exists | |
/usr/libexec/PlistBuddy -c "Delete :NSAppTransportSecurity" "${TARGET_INFOPLIST}" 2>/dev/null |
NewerOlder