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: publish | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
publish-docker-image: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 |
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
# Use an official Node.js runtime as a parent image | |
FROM node:14 | |
# Set the working directory to /app | |
WORKDIR /app | |
# Copy package.json and package-lock.json to the container | |
COPY package*.json ./ | |
# Install dependencies |
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
/** | |
* Author: Mitch Allen | |
* https://scriptable.com | |
* https://mitchallen.com | |
*/ | |
const express = require('express'); | |
const app = express(); | |
const port = 3000; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="button.css"> | |
</head> | |
<body> | |
<button id="changeColor"></button> | |
<script src="popup.js"></script> | |
</body> | |
</html> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Options Page</title> | |
</head> | |
<body> | |
<h1>Options Page</h1> | |
<form> | |
<label for="color-input">Page Background Color:</label> |
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
console.log("Background script loaded!"); | |
chrome.browserAction.onClicked.addListener(function(tab) { | |
// Do something when the extension button is clicked | |
}); |
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
console.log("Hello, world!"); | |
chrome.storage.sync.get("color", function(data) { | |
var color = data.color || "#ffffff"; | |
document.body.style.backgroundColor = color; | |
}); |
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": "My Extension", | |
"version": "1.0", | |
"manifest_version": 3, | |
"description": "Description of my extension", | |
"permissions": [ | |
"tabs", | |
"activeTab" | |
], | |
"content_scripts": [ |
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
r.POST("/users", func(c *gin.Context) { | |
var user struct { | |
Name string `json:"name"` | |
Email string `json:"email"` | |
} | |
if err := c.BindJSON(&user); err != nil { | |
c.JSON(400, gin.H{"error": err.Error()}) | |
return | |
} | |
// TODO: create user in database |
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
r.GET("/users", func(c *gin.Context) { | |
users := []string{"Alice", "Bob", "Charlie"} | |
c.JSON(200, gin.H{ | |
"users": users, | |
}) | |
}) |