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/bash | |
# Function to find the container ID of a service's first running task | |
find_container_id() { | |
local service_name=$1 | |
docker service ps --filter "desired-state=running" --format "{{.ID}}" $service_name | head -n 1 | xargs -I {} docker inspect --format "{{.NodeID}} {{.Status.ContainerStatus.ContainerID}}" {} | awk '{print $2}' | |
} | |
# Function to extract the database name from the service name | |
extract_db_name() { |
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 __fish_nx_commands | |
printf "%s\t%s\n" \ | |
"create-nx-workspace" "Create a new Nx workspace" \ | |
"init" "Initialize an Nx workspace" \ | |
"generate" "Generate code for workspace" \ | |
"run" "Run a target for a project" \ | |
"daemon" "Run the Nx daemon" \ | |
"graph" "Graph dependencies in workspace" \ | |
"run-many" "Run target for multiple projects" \ | |
"affected" "Run target for affected projects" \ |
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
BEGIN; | |
-- Ensure indexes are in place for performance | |
CREATE INDEX IF NOT EXISTS idx_activity_timestamp ON directus_activity (timestamp); | |
CREATE INDEX IF NOT EXISTS idx_revisions_activity ON directus_revisions (activity); | |
CREATE INDEX IF NOT EXISTS idx_revisions_item_collection ON directus_revisions (item, collection); | |
CREATE INDEX IF NOT EXISTS idx_notifications_timestamp ON directus_notifications (timestamp); | |
DO $$ | |
DECLARE |
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/bash | |
# Function to find the container ID of a service's first running task | |
find_container_id() { | |
local service_name=$1 | |
docker service ps --filter "desired-state=running" --format "{{.ID}}" $service_name | head -n 1 | xargs -I {} docker inspect --format "{{.NodeID}} {{.Status.ContainerStatus.ContainerID}}" {} | awk '{print $2}' | |
} | |
# Function to extract the database name from the service name | |
extract_db_name() { |
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
import type { ImageLoaderProps } from 'next/image' | |
const imgDomain = process.env.NEXT_PUBLIC_IMG_DOMAIN ?? '' | |
interface DirectusImageProps { | |
fit?: 'cover' | 'contain' | 'inside' | 'outside' | |
} | |
export default function directusImageLoader({ | |
src: imageID, |
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
#cloud-config | |
package_update: true | |
package_upgrade: true | |
package_reboot_if_required: true | |
manage-resolv-conf: true | |
resolv_conf: | |
nameservers: | |
- '8.8.8.8' |
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
echo "Creating an SSH key for you..." | |
ssh-keygen -t rsa | |
echo "Please add this public key to Github \n" | |
echo "https://github.com/account/ssh \n" | |
read -p "Press [Enter] key after this..." | |
echo "Installing xcode-stuff" | |
xcode-select --install |
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/bash | |
######################## | |
### DOCKER & LANDO ### | |
######################## | |
sudo apt-get update | |
sudo apt-get install \ | |
apt-transport-https \ |
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 fnDrawPrism(length, numWidth, intHeight){ | |
//If any of these parameters are undefined, throw an error that lists the missing parameters. | |
// you can cut-and-past the declaration line to fill out 90% of the validation call: | |
validate(fnDrawPrism, length, numWidth, intHeight); | |
return length * numWidth * intHeight; | |
} | |
// this is cut-and-pasted into a file somewhere, edit to add more types or stricter checking | |
function validate(args){ |
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
angular.module('firebase-example', ['js-data', 'ngRoute']) | |
.config(function (DSFirebaseAdapterProvider, $routeProvider) { | |
var basePath = 'https://js-data-firebase.firebaseio.com'; | |
DSFirebaseAdapterProvider.defaults.basePath = basePath; | |
$routeProvider.when('/user/:id', { | |
controller: 'UserCtrl', | |
controllerAs: 'UserCtrl', | |
template: 'routes/user/user.html', | |
resolve: { |
NewerOlder