Skip to content

Instantly share code, notes, and snippets.

Avatar

Svale Fossåskaret svale

View GitHub Profile
@svale
svale / deploy.sh
Last active Feb 5, 2020
Zero down time deployment script for static generate sites on forge
View deploy.sh
#!/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 Dec 6, 2019
My default prettier config
View .prettierrc.js
module.exports = {
singleQuote: true,
semi:false,
printWidth: 120
}
@svale
svale / _entry.twig
Last active Aug 28, 2019
Skogkart PoC Craft templates
View _entry.twig
{# 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 Jun 11, 2018 — forked from engram-design/export.php
ExpressionEngine PHP Export into JSON
View export.php
<?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 Feb 7, 2018
Responsive CSS Grid Layout
View .block
license: gpl-3.0
width: 599
border: yes
@svale
svale / .block
Last active Mar 20, 2018
Scrolling morphing area stack
View .block
license: gpl-3.0
height: 720
border: yes
scrolling: yes
@svale
svale / .block
Last active Jan 1, 2020
Morphing Streamgraph
View .block
license: gpl-3.0
height: 720
border: no
@svale
svale / .block
Last active Oct 26, 2017
Multiple Series Line Chart
View .block
license: gpl-3.0
height: 720
border: no
@svale
svale / .block
Last active Jun 30, 2019
Remittances Chord Diagram
View .block
license: gpl-3.0
height: 960
border: no