Skip to content

Instantly share code, notes, and snippets.

@mvanholsteijn
mvanholsteijn / update-all-route53-domains-contacts.py
Created February 10, 2020 14:48
update the contacts of all route53 registered domains
import boto3
import json
contact = {
"FirstName": "Mark",
"LastName": "van Holsteijn",
"ContactType": "COMPANY",
"AddressLine1": "Laapersveld 27",
"City": "Hilversum",
"CountryCode": "NL",
@bayareawebpro
bayareawebpro / laravel-bitbucket-pipelines.yml
Last active January 4, 2022 05:07
Bitbucket Pipelines for Laravel
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# You can specify a custom docker image from Docker Hub as your build environment.
# run composer check-platform-reqs for a list of required extensions.
image: php:7.2-fpm
pipelines:
default:
# Not needed unless you're doing feature tests.
# - step:
@PiDayDev
PiDayDev / cherry-picky.sh
Last active October 8, 2023 18:16
Partial cherry-pick
#!/usr/bin/env bash
# Usage: ./cherry-pick <commit SHA or tag>
# It will cherry-pick given commit, but will only commit files in "src/" folder, skipping the rest.
# Bonus: the commit message and authorship information including the timestamp are copied from cherry-picked commit
# Credits to https://stackoverflow.com/a/5717615/7193150
git cherry-pick -n $1
git reset HEAD
git add src/
@javilobo8
javilobo8 / download-file.js
Last active April 9, 2024 12:01
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active May 6, 2024 20:49
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"