Skip to content

Instantly share code, notes, and snippets.

View Gogoro's full-sized avatar

Ole Andreas Jørnsen Herland Gogoro

View GitHub Profile
@Gogoro
Gogoro / Craft CMS 3 - Menu with sections.twig
Last active June 13, 2018 12:56
I made a simple menu with sections now that the menu plugin for craft is not working for Craft 3 :)
<ul>
{% for node in craft.entries.section('MainMenu') %}
{% set url = null %}
{% if node.linkedEntry is defined and node.linkedEntry |length > 0 %}
{% set url = node.linkedEntry.first().getUrl() %}
{% elseif node.pageUrl |length > 0 %}
{% set url = node.pageUrl %}
{% endif %}
{% if url |length > 0 %}
@Gogoro
Gogoro / wordpress-one-click-install.sh
Created February 25, 2019 18:56
To skip the install page for WordPress, curl with these vars.
#/bin/bash
# Env vars
WP_DOMAIN="blog.bvzzdesign.com"
WP_ADMIN_USERNAME="admin"
WP_ADMIN_PASSWORD="admin"
WP_ADMIN_EMAIL="no@spam.org"
WP_DB_NAME="wordpress"
WP_DB_USERNAME="wordpress"
@Gogoro
Gogoro / read-access.sql
Created May 16, 2019 11:16 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@Gogoro
Gogoro / git-deployment.md
Created December 16, 2019 18:20 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.