Skip to content

Instantly share code, notes, and snippets.

View orlissenberg's full-sized avatar

Onno Lissenberg orlissenberg

View GitHub Profile
@orlissenberg
orlissenberg / create_table.j2
Last active October 11, 2020 21:48
Create a PostgreSQL schema from yaml, use mixins for column patterns.
CREATE TABLE IF NOT EXISTS {{ table.name }} (
{% for column in table.getColumns() %}{{ "\t" }}{{ column }}{% if not loop.last %},{{ "\n" }}{% endif %}{% endfor %}
);
{% for foreignKey in table.getForeignKeys() %}
ALTER TABLE {{ table.name }}
ADD CONSTRAINT {{ foreignKey.name }}
FOREIGN KEY ({{ ", ".join(foreignKey.columns) }})
REFERENCES {{ foreignKey.reference }}({{ ", ".join(foreignKey.referenceColumns) }});
{# ON DELETE CASCADE #}
{% endfor %}
@orlissenberg
orlissenberg / ExportPages.jsx
Created May 29, 2019 11:05
Export InDesign pages to individual files with custom file name.
/**
* Export InDesign pages to individual files with custom file name.
*
* References:
*
* https://www.indesignjs.de/extendscriptAPI/indesign-latest/index.html#ExportFormat.html
* https://github.com/ExtendScript/wiki/wiki
*
* License: MIT
*/
Ik schrijf u in uw hoedanigheid als gegevensbeschermingsfunctionaris voor uw bedrijf.
Door een situatie waarin uw bedrijf mij zonder expliciete toestemming heeft aangemeld voor solliciaties bij bedrijven die geen relevantie houden tot mijn profiel heb ik zorgen over de verwerking van data binnen uw bedrijf.
Ik zou graag willen dat u van meet af aan weet dat ik binnen een maand antwoord verwacht op mijn verzoek, zoals vereist krachtens artikel 12, bij gebreke waarvan ik mijn verzoek zal doorzenden met een klachtbrief aan de bevoegde autoriteiten.
Gelieve het volgende te adviseren:
1. Bevestig mij of mijn persoonlijke gegevens worden verwerkt. Als dit het geval is, geef me dan de categorieën persoonlijke gegevens die u over mij hebt in uw bestanden en databases.
@orlissenberg
orlissenberg / tmux-cheatsheet.markdown
Created September 8, 2016 07:02 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@orlissenberg
orlissenberg / oracle_instant_client_php7.md
Created January 15, 2016 17:36
Install the Oracle instant client via pecl on jessie for PHP 7

#Oracle Database Instant Client Installation

Download

cd /opt
sudo unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip
sudo unzip instantclient-basic-linux.x64-12.1.0.2.0.zip

cd /opt/instantclient_12_1

sudo ln -s libclntsh.so.12.1 libclntsh.so

@orlissenberg
orlissenberg / example-nginx.conf
Last active August 29, 2015 14:26
Nginx PHP configuration example.
# http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files
# http://laravel-recipes.com/recipes/26/creating-a-nginx-virtualhost
server {
listen 80;
server_name www.sitename.dev sitename.dev;
charset utf-8;
access_log /var/log/nginx/sitename.access.log;
error_log /var/log/nginx/sitename.error.log;
@orlissenberg
orlissenberg / redeploy_nginx_config.sh
Created August 3, 2015 07:43
Nginx configuration script.
#!/usr/bin/env bash
sudo rm /etc/nginx/sites-enabled/example.conf
sudo cp /vagrant/projects/a-project/nginx/example.conf /etc/nginx/sites-available/example.conf
sudo ln -s /etc/nginx/sites-available/example.conf /etc/nginx/sites-enabled/example.conf
# http://wiki.nginx.org/CommandLine
# /usr/bin/nginx -t
@orlissenberg
orlissenberg / rsync_local.sh
Created August 3, 2015 07:34
Continuous rsync.
#!/usr/bin/env bash
# https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps
while true ; do
rsync -aP /vagrant/projects/a-project/ /srv/www//a-project
sleep 2 # seconds
done
@orlissenberg
orlissenberg / ansible_notes.yml
Last active August 29, 2015 14:26
Ansible tricks.
---
# http://docs.ansible.com/ansible/playbooks_conditionals.html
- name: Get platform specific variables.
include_vars: "{{ansible_os_family}}.yml"
when: ansible_os_family == "Debian" or ansible_os_family == "RedHat"
# Ansible 1.9 introduced the new becomes syntax
# http://stackoverflow.com/questions/21344777/how-to-switch-a-user-per-task-or-set-of-tasks
- name: checkout repo
@orlissenberg
orlissenberg / php5.6_soap_example.php
Created July 10, 2015 11:09
SOAP / PHP 5.6.7 (Zend Server 8) stream context TLS - Failed to load external entity.
<?php
// http://php.net/manual/en/migration56.openssl.php
if (version_compare(phpversion(), '5.6', '>='))
{
$wsdl = 'https:// ...'
$opts = array(
'ssl' => array(