Skip to content

Instantly share code, notes, and snippets.

View LukaHarambasic's full-sized avatar

Luka Harambasic LukaHarambasic

View GitHub Profile
@LukaHarambasic
LukaHarambasic / functions.php
Last active August 8, 2021 10:32
Wordpress: ACF-Field as CPT Title
// inspired by: https://gist.github.com/rveitch/9018669face1686e74aaa68026856f36
// add title to CPTs which don't provide a title (useful for the relationship field (https://www.advancedcustomfields.com/resources/relationship/))
function sync_acf_post_title($post_id, $post, $update) {
$post_type = get_post_type($post_id);
// check for the current CPT
if($post_type === "cpt_name_1") {
@LukaHarambasic
LukaHarambasic / index.js
Created April 17, 2019 12:42
now-express
const bodyParser = require( 'body-parser' )
const express = require( 'express' )
const morgan = require( 'morgan' )
const { Client } = require( 'pg' )
const squel = require( 'squel' )
console.log('START')
const CLIENT = new Client({
<<TOP-SECRET>>
@LukaHarambasic
LukaHarambasic / checks.yml
Last active December 21, 2020 21:52
GitHub Action: execute lint and test on push for each pull request (PR) - easy to adapt for other npm/yarn scripts - works with Netlfiy and Vercel - just add the following file in the following directory `.github/workflows/checks.yml`
name: Checks
on: push
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run lint
@LukaHarambasic
LukaHarambasic / docker-compose.yml
Last active January 11, 2021 22:25
Docker Compose for NextCloud with Traefik 2 (SSL)
version: '3.7'
services:
db:
image: mariadb:latest
container_name: nextcloud_db
volumes:
- nextcloud-db:/var/lib/mysql
networks: