Skip to content

Instantly share code, notes, and snippets.

View DevShaded's full-sized avatar
💭
I may be slow to respond.

Fredrik DevShaded

💭
I may be slow to respond.
View GitHub Profile
@hannafyllingen
hannafyllingen / index.html
Last active May 5, 2025 10:41
Index html for api utvikling
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random CAT</title>
<style>
body {
display: flex;
@kjartan
kjartan / Connect to MySQL
Last active November 25, 2024 13:16
Synced via Snip
<?php
$user = "example_user";
$password = "password";
$database = "example_database";
$table = "todo_list";
try {
$db = new PDO("mysql:host=localhost;dbname=$database", $user, $password);
echo "<h2>TODO</h2><ol>";
foreach($db->query("SELECT content FROM $table") as $row) {
# SETUP #
DOMAIN=example.com
PROJECT_REPO="git@github.com:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@azagniotov
azagniotov / beautiful.rest.api.docs.in.markdown.md
Last active April 19, 2026 17:58
Example to create beautiful REST API docs in Markdown, inspired by Swagger API docs.