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
stages: | |
- build | |
- deploy | |
variables: | |
S3_BUCKET: "bucket" | |
S3_ARCHIVE_PATH_PROD: "production/" | |
build: | |
image: docker:latest |
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 | |
echo "Updating system..." | |
sudo apt update | |
echo "Installing dependencies..." | |
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common | |
echo "Downloading data..." | |
sudo apt install -y curl |
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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: "Template description" | |
Parameters: | |
AppEnvironment: | |
Type: String | |
Default: production | |
EC2InstanceType: | |
Type: String | |
Default: a1.medium |
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
# Cache node modules - speeds up future builds | |
cache: | |
paths: | |
- node_modules | |
stages: | |
- build | |
- run | |
variables: |
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
<?php | |
/** | |
* This little class records how long it takes each WordPress action or filter | |
* to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
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 | |
set -euo pipefail | |
IFS=$'\n\t' | |
# Ubuntu 20/22 dev Server | |
# Run like (without sudo) - bash install_lamp.sh | |
# Script should auto terminate on errors | |
export DEBIAN_FRONTEND=noninteractive |
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 | |
# Fetch Cloudflare log data for a given Ray ID | |
# Please note that the Ray ID is the first part of `CF-RAY` (4a807f60ca5727a4-FRA -> 4a807f60ca5727a4) | |
CF_ZONE=${1} | |
RAY_ID=${2} | |
if ! host -N 0 "${CF_ZONE}" 2>&1 > /dev/null; then | |
echo "Invalid domain '${CF_ZONE}'" |
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
name: CI/CD workflow | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
testing: |
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
<div class="flex flex-col items-center"> | |
<div class="w-full md:w-1/2 flex flex-col items-center h-64"> | |
<div class="w-full px-4"> | |
<div x-data="selectConfigs()" x-init="fetchOptions()" class="flex flex-col items-center relative"> | |
<div class="w-full"> | |
<div @click.away="close()" class="my-2 p-1 bg-white flex border border-gray-200 rounded"> | |
<input | |
x-model="filter" | |
x-transition:leave="transition ease-in duration-100" | |
x-transition:leave-start="opacity-100" |
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 facebook | |
import requests | |
import json | |
import os | |
# Your access token | |
#access_token = '<your-access-token>' | |
access_token = os.environ.get('FACEBOOK_ACCESS_TOKEN') | |
# The Facebook API endpoint to get your posts | |
api_endpoint = f'https://graph.facebook.com/v16.0/me?fields=id,name,posts&access_token={access_token}' |