Skip to content

Instantly share code, notes, and snippets.

@svale
svale / diagrams.md
Last active June 15, 2023 13:57
Mermaid Craft Diagramn
graph LR

W((<br>fa:fa-globe<br>Nettside<br><br>))
C(fa:fa-pen<br>Craft CMS)
D[(fa:fa-database<br>MySQL)]
S[fa:fa-server<br>Filserver]
B[fa:fa-image<br>Bildeserver]
Q[fa:fa-wifi GraphQL API ]
I[Mulige integrasjoner]
@svale
svale / Brewfile
Last active August 28, 2022 16:06
Brew installs
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/services"
tap "planetscale/tap"
tap "shivammathur/php"
brew "webp"
brew "apr-util"
brew "bat"
@svale
svale / image.twig
Created August 20, 2022 16:33
A reusable image twig component
{# Image
This is an image component template for echoing image tags in a twig template.
Output:
<figure>
<img />
<figcaption></figcaption>
</figure
It takes the following props:
@svale
svale / deploy.sh
Last active February 5, 2020 12:03
Zero down time deployment script for static generate sites on forge
#!/bin/bash
set -e
# ./deploy/-deploy.sh
# Deployment with zero downtime
# Based on : https://gist.github.com/actionm/63b927a9b933e54414ae2857e5712162
# By default keeps 2 last deployments in KEEP_DEPLOYMENTS_DIR and current deployment
usage()
{
@svale
svale / .prettierrc.js
Created December 6, 2019 10:07
My default prettier config
module.exports = {
singleQuote: true,
semi:false,
printWidth: 120
}
@svale
svale / _entry.twig
Last active August 28, 2019 13:23
Skogkart PoC Craft templates
{# Globale settings som settes i egne felter CMSet #}
{% set mapUrl = mapSettings.mapUrl %}
{% set mapVersion = mapSettings.mapVersion|default( 'now'|date('U') ) %}
{# Kartet boostrappes #}
{% set output = 'script' %}
<!doctype html>
<html class="no-js" lang="">
<head>
@svale
svale / export.php
Last active June 11, 2018 13:51 — forked from engram-design/export.php
ExpressionEngine PHP Export into JSON
<?php
header('Content-type: application/json; charset=utf-8'); //Setting the page Content-type
$content = array();
$channel = $_GET['id'];
$fields_query_string = "SELECT * FROM exp_channel_fields LEFT JOIN exp_channels ON exp_channel_fields.group_id = exp_channels.field_group WHERE exp_channels.channel_id = '$channel'";
$entries_query_string = "SELECT * FROM exp_channel_data cd INNER JOIN exp_channel_titles ct ON cd.entry_id = ct.entry_id WHERE cd.channel_id = '$channel'";
// query single field
if(isset($_GET['field'])) {
@svale
svale / .block
Last active February 7, 2018 09:39
Responsive CSS Grid Layout
license: gpl-3.0
width: 599
border: yes
@svale
svale / .block
Last active March 20, 2018 11:15
Scrolling morphing area stack
license: gpl-3.0
height: 720
border: yes
scrolling: yes