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: { |
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
var cordova; | |
cordova = { | |
exec: function(listener, errorHandler, pluginName, action, payload) { | |
return console.log("Received " + action + " with payload:", payload); | |
} | |
}; |
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
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.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
git remote | grep -q frbit-stage || git remote add frbit-stage git@git1.eu1.frbit.com:my-app-stage.git | |
git push frbit-master refs/heads/stage:refs/heads/master |
NewerOlder