Skip to content

Instantly share code, notes, and snippets.

pages:
name: Pages
singular_name: Page
fields:
title:
type: text
class: large
group: content
slug:
type: slug
@jadwigo
jadwigo / contenttypes.yml
Last active November 18, 2016 14:21
FAQ section in bolt
pages:
name: Pages
singular_name: Page
fields:
title:
type: text
class: large
group: content
slug:
type: slug
@jadwigo
jadwigo / test.php
Last active December 6, 2016 11:32
<?php
guesstimate_file_location($boltforms_location, $public_location) {
$tested = false;
$formfilename = $boltforms_location . '/testfile.txt';
$publicfilename = $public_location . '/testfile.txt';
$timestamp = microtime();
if(file_put_contents ( $formfilename , $timestamp )) {
@jadwigo
jadwigo / lookup-provincie.php
Created August 16, 2017 10:44
Lookup Nederlandse provincie ahv. cijfers van de postcode
<?php
/**
* Lookup provincie ahv postcode:
* https://nl.wikipedia.org/wiki/Postcodes_in_Nederland
*
* @param $postcode
*
* @return string
*/
function lookupProvincie($postcode) {
@jadwigo
jadwigo / basic-form.html
Last active November 28, 2017 14:46
A selection of fields and markup that a real form might have.
<html>
<head>
<title>Form example</title>
<style>
body {
margin: 1em auto;
max-width: 60em;
}
form {
width: 60%;
@jadwigo
jadwigo / config.xml
Last active October 5, 2018 18:15
Cordova cli-8.0.0 config.xml for geolocation
<?xml version='1.0' encoding='utf-8'?>
<widget
id="com.example.appname"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0"
xmlns:gap="http://phonegap.com/ns/1.0"
versionCode="10203"
version="1.2.3">
<name>appname</name>
@jadwigo
jadwigo / composer.json
Created July 31, 2018 13:37
Bolt extension from custom git repository
{
"autoload": {
"psr-4": {
"Bolt\\Composer\\EventListener\\": "../vendor/bolt/bolt/src/Composer/EventListener"
}
},
"config": {
"discard-changes": true,
"preferred-install": "dist"
},
@jadwigo
jadwigo / master.twig
Created September 27, 2018 10:05
Master with header includes
<!doctype html>
<html class="no-js" lang="{{ htmllang() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{%- if seo.title is defined -%}
{{ seo.title }}
{%- elseif record.title is defined -%}
{{ record.title }} | {{ config.get('general/sitename') }}
@jadwigo
jadwigo / backup.sql
Created January 14, 2019 10:29
Backup and restore a mysql database
mysqldump -u {user} -p{pass} {db} > {outputfile}.sql
@jadwigo
jadwigo / split.sh
Created January 31, 2019 12:14
move many files to subdirectories
#!/bin/bash
# This script takes a directory with many files and moves all nnormal files
# to a subdirectory with the year-month
for i in *
do
if [ -f "$i" ]
then
filemonth=`stat --format=%y "$i" | cut -c 1-7`