Skip to content

Instantly share code, notes, and snippets.

View Pictor13's full-sized avatar
🤹‍♂️
Juggling with curiosity

Igor Pellegrini Pictor13

🤹‍♂️
Juggling with curiosity
  • BerlinOnline Stadtportal GmbH & Co. KG
  • Berlin
View GitHub Profile
@Pictor13
Pictor13 / 20250213-dataset_with_resources_fisbriker.berlin.de.txt
Created February 18, 2025 18:58 — forked from knudmoeller/20250213-dataset_with_resources_fisbriker.berlin.de.txt
Datasets with resources in fbinter.stadt-berlin.de (but not in gdi.berlin.de)
https://daten.berlin.de/datensaetze/20-grune-hauptwege-wanderkarte-wfs-99a22ff0
https://daten.berlin.de/datensaetze/20-grune-hauptwege-wanderkarte-wms-1f028343
https://daten.berlin.de/datensaetze/3d-gebaudemodelle-im-level-of-detail-1-lod-1-atom-e2a1e24e
https://daten.berlin.de/datensaetze/3d-gebaudemodelle-im-level-of-detail-2-lod-2-atom-3c7c49af
https://daten.berlin.de/datensaetze/3d-gebaudemodelle-im-level-of-detail-2-lod-2-wms-f2a8a483
https://daten.berlin.de/datensaetze/abstellflachen-fur-mikromobilitatsangebote-wfs-6185b5fb
https://daten.berlin.de/datensaetze/abstellflachen-fur-mikromobilitatsangebote-wms-e45c2176
https://daten.berlin.de/datensaetze/adressen-berlin-wfs-634ab8ba
https://daten.berlin.de/datensaetze/adressen-berlin-wms-130748fb
https://daten.berlin.de/datensaetze/adressen-im-inspire-datenmodell-atom-3bd15407
https://daten.berlin.de/datensaetze/abstellflachen-fur-mikromobilitatsangebote-wfs-6185b5fb
https://daten.berlin.de/datensaetze/abstellflachen-fur-mikromobilitatsangebote-wms-e45c2176
https://daten.berlin.de/datensaetze/adressen-berlin-wfs-634ab8ba
https://daten.berlin.de/datensaetze/adressen-berlin-wms-130748fb
https://daten.berlin.de/datensaetze/adressen-im-inspire-datenmodell-wms-ee802686
https://daten.berlin.de/datensaetze/adressen-regionales-bezugssystem-rbs-wfs-c43966c4
https://daten.berlin.de/datensaetze/adressen-regionales-bezugssystem-rbs-wms-d1c67d30
https://daten.berlin.de/datensaetze/afis-berlin-wfs-1408ef18
https://daten.berlin.de/datensaetze/afis-berlin-wms-c4897b9f
https://daten.berlin.de/datensaetze/alkis-berlin-bezirke-wfs-ced31d7d
@Pictor13
Pictor13 / anonymousFactory.php
Last active November 10, 2024 00:08 — forked from MarkBaker/anonymousFactory.php
Dynamic Instantiation of a class with optional Traits
<?php
class AnonymousClassBuilder {
private string $className;
private array $traits;
public function __construct(string $className) {
$this->className = $className;
}
@Pictor13
Pictor13 / replacement.md
Created March 19, 2024 09:45
Helm Values replacement (to only have a single one, rather than one per-environment)

FROM: helm/helm#10026 (comment)

As I have not found any easy way to use environment variables in the values.yaml have I used this line to full fill the requirements.

CI_ENVIRONMENT_SLUG=lala envsubst < charts/values.yaml| helm \
  --kubeconfig ../kubeconf-dev \
  -n mynamespace install --create-namespace -f - --dry-run myapp ./mycharts
@Pictor13
Pictor13 / amazon-search-result-filter.js
Last active November 2, 2023 00:18
Amazon - Hide unwanted search results permanently (localStorage)
/**
* Running this snippet in the browser console, when being on Amazon's result page,
* will provide a button to hide results permanently.
*
* TODO:
* - add option to insert and store also a description
* for the hidden products (for bugs, drawbacks, or other user notes)
* - support sync to cloud, in order to not loose the list when clearing
* browser cache
* - support public blacklists to share among users (practically, a rate
@Pictor13
Pictor13 / example_state-behaviour.js
Created July 28, 2023 03:24
Generic concerns separation
// benefits? disadvantages?
// state type-interface
type State = {
name: string,
age: number,
gender: string,
hobby: Array<string>
}
@Pictor13
Pictor13 / handle User & Manual click.js
Created July 26, 2023 00:55
Distinguish event triggered by User or by jQuery (+ cloneEvent & EventProxy examples)
const getCopy = obj => new Proxy(
obj,
{
get: function( target, prop, receiver ) {
let value = target[ prop ];
/*copy array*/ if ( Array.isArray( value ) ) return value.slice( 0 );
/*copy object*/ if ( typeof value === "object" && value.constructor.name === "Object" ) return Object.assign( {}, value );
/*copy primitive*/ return value;
}
}

Instructions

I want a dockerfile to bring up a container wiith php 8.0, supporting german language either in the OS and inside PHP.
The create a user"app"; the user has UID and GID configurable as APP_UID and APP_GID docker build arguments; the arguments have default value 61234.
The basic php extensions should be enabled; especially for XSLT, XML dom operations, german language support; but skip PECL packages and extensions that are unlikely to be used. In any case, don't exceed with the number of extensions installed; this is not a "production" Dockerfile! Node 14 and npm should be also present in the container.
Switch to the user "app".
Then copy into the container /app folder the composer.json, composer.lock and package.json and package-lock.json from the host machine.
Then install the compser & npm dependencies.
Try to be minimalistic in the instructions; don't repeat too many times the same command. Keep it simple!

@Pictor13
Pictor13 / HardCoreDebugLogger.php
Created January 31, 2023 07:26 — forked from lyrixx/HardCoreDebugLogger.php
Hardcore Debug Logger
<?php
const STREAM_OPEN_FOR_INCLUDE = 128;
final class HardCoreDebugLogger
{
public static function register(string $output = 'php://stdout')
{
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
```
#### PHP information
php -v
php -r 'phpinfo();'
#### Find user running PHP Cli on a Kubernetes deployment
k exec deploy/vergabeplattform app -- php -r '$ot=[];exec("id", $ot);var_export($ot);'
```