Skip to content

Instantly share code, notes, and snippets.

View nezhar's full-sized avatar
🐍
If the implementation is hard to explain, it's a bad idea.

Harald Nezbeda nezhar

🐍
If the implementation is hard to explain, it's a bad idea.
View GitHub Profile
@nezhar
nezhar / migrate-django.md
Created December 16, 2021 08:50 — forked from sirodoht/migrate-django.md
How to migrate Django from SQLite to PostgreSQL

How to migrate Django from SQLite to PostgreSQL

Dump existing data:

python3 manage.py dumpdata > datadump.json

Change settings.py to Postgres backend.

Make sure you can connect on PostgreSQL. Then:

/*
Angular2 Component //red
<parent> //blue
<child></child> //orange
<child class="class1"></child> //yellow
<child class="class2"></child> //pink
</parent>
*/
:host { color: red; }
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
@Pipe({
name: 'safe'
})
export class SafePipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) { }
@nezhar
nezhar / PHP7 Docker Xdebug Config
Last active September 4, 2022 15:56
Configuration for XDEBUG to use in PHPStorm
from wordpress:php7.0-apache
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo xdebug.remote_enable=1 >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo xdebug.remote_autostart=0 >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo xdebug.remote_connect_back=1 >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo xdebug.remote_port=9000 >> /usr/local/etc/php/conf.d/xdebug.ini
EXPOSE 9000