Skip to content

Instantly share code, notes, and snippets.

View myHerbDev's full-sized avatar
🎸
myHerb Happening

myHerb myHerbDev

🎸
myHerb Happening
View GitHub Profile
@myHerbDev
myHerbDev / aws-eco-runner.yml
Created November 4, 2024 15:35
AWS Eco Runner is a solution designed to optimize the cost of using GitHub Actions runners
# Installation code.
- name: aws-eco-runner
# You may pin to the exact commit or the version.
# uses: nodesource/aws-eco-runner@625920a3e23912bd416b27296717326a93063812
uses: nodesource/[email protected]
with:
# Array with ID of the EC2 instance to start OR stop
instances_id:
# Define if I want to start or stop the runner
action: # default is start
@myHerbDev
myHerbDev / dart
Created September 3, 2024 07:25
Flutter app with navigation
Your Flutter code sets up a basic app with a home page that has a nice gradient background and a few UI elements like a title, a subtitle, and a button.
Here are a few improvements or additional features you might consider:
a. Add a navigation feature to the button so it opens a new page when pressed.
b. Include animations to enhance the user experience when transitioning between screens.
c. Refactor the UI elements into separate widgets to improve code organization and readability.
@myHerbDev
myHerbDev / gist:7e86b97e6fcc8106576d3c977b72f2bb
Last active September 2, 2024 07:51
Data Pipelines API | Postman
<a href="https://myherb.postman.co/collection/30813888-2858eda1-9843-467f-b165-6c01c613eb1d?source=rip_html&active-environment=30813888-1d5bc2bd-ce48-41d4-b822-528539ee8345">
<img alt="Run in Postman" src="https://run.pstmn.io/button.svg">
</a>
@myHerbDev
myHerbDev / generative-ai-prompt-v1.txt
Last active June 24, 2024 18:20
Install the Google AI Python SDK - Generative AI Prompt
"""
Install the Google AI Python SDK
$ pip install google-generativeai
See the getting started guide for more information:
https://ai.google.dev/gemini-api/docs/get-started/python
"""
import os
@myHerbDev
myHerbDev / Zapier Integration for Website Sustainability Testing
Created May 20, 2024 15:41
Zapier Integration for Website Sustainability Testing
import requests
# Get website URL from trigger data
website_url = trigger_data["url"]
# Define API endpoint for sustainability testing
api_endpoint = "https://api.example.com/sustainability"
# Send request to API with website URL
response = requests.get(api_endpoint, params={"url": website_url})
@myHerbDev
myHerbDev / Test the website's sustainability with PageSpeed.txt
Last active May 20, 2024 15:39
Test the website's sustainability with PageSpeed
import requests
from zapier.platform.app import Zap
from zapier.platform.intent import Intent
from zapier.platform.user import User
class GooglePageSpeedInsights(Zap):
"""
Zapier integration for Google PageSpeed Insights
"""
@myHerbDev
myHerbDev / This script calculates the carbon footprint based on the distance traveled using different transportation modes
Created March 3, 2024 18:19
Python script that calculates the carbon footprint of a person based on their transportation habits
def calculate_carbon_footprint(transportation_modes):
carbon_emissions = {
"car": 0.2, # kg CO2 per km
"bus": 0.15,
"train": 0.1,
"bicycle": 0,
"walking": 0
}
total_emissions = 0
import requests
# Get the URL of the website you want to check
url = "https://www.example.com"
# Make a request to the website
response = requests.get(url)
# Get the carbon footprint of the website
carbon_footprint = response.headers["X-Carbon-Footprint"]
import requests
# Get the URL of the website you want to check
url = "https://www.example.com"
# Make a request to the website
response = requests.get(url)
# Get the carbon footprint of the website
carbon_footprint = response.headers["X-Carbon-Footprint"]
Voluptate ea aliquam. Quaerat ut voluptatem odit quas maiores. Optio est aut.
Voluptatem adipisci quos et quasi. Sequi sequi assumenda sunt rerum aliquam. Deleniti tenetur sed. Soluta et vel ut ex commodi. Aut iste libero accusamus velit et. Voluptas ab aut ut.
Doloribus et ut et reiciendis voluptas pariatur sit placeat. Sit tenetur voluptatem assumenda maxime suscipit enim et eos rem. Qui explicabo unde et et. Cupiditate fugit minus fuga at.