Skip to content

Instantly share code, notes, and snippets.

View sochi's full-sized avatar

Jan Sochor sochi

View GitHub Profile
<?php
namespace App\Model;
class ToStringObject {
private $data;
private $primaryKey;
@sochi
sochi / common.neon
Created June 2, 2020 16:16
Configure Nette to use trust HTTP proxy when running in docker
# docker is apparently using the range of 172.16.0.0/12 for networking by default
#
# and Nette by default routes and redirects based on remote addresses in $_SERVER,
# which means that it redirects using the internal ports, e.g., 8080, which are in
# most cases different from mapped ports
#
# though Nette can be instructed to trust the forwarded values, using its http.proxy
# configuration, to use the forwarded values (in routing and redirects) the remote
# has to be specified as a trusted proxy
#
@sochi
sochi / .docker-private-registry-with-read-write-control.md
Created February 5, 2020 20:01
Run docker private registry with read/write access control
@sochi
sochi / git_instructions.md
Last active May 26, 2019 19:54 — forked from ZeroDragon/How to clone a git repo to an existing folder (not empty).md
Clone a git repository to an existing non-empty folder

Clone a git repository to an existing folder

  1. Get to the existing directory
cd my/folder/
  1. Now start a new git repository
$ git init
@sochi
sochi / docker_cheat_sheat.md
Last active May 24, 2019 22:24 — forked from dwilkie/docker-cheat-sheat.md
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@sochi
sochi / csv_parser.py
Last active May 25, 2019 21:28
short CSV parser in python
from typing import Iterable, List
def parse_line(line: str) -> List[str]:
words = list()
quote_character = None
escaped = False
word = ""