Skip to content

Instantly share code, notes, and snippets.

View mstenta's full-sized avatar
🥚

Michael Stenta mstenta

🥚
View GitHub Profile
@woodbri
woodbri / parse-kml.php
Created November 1, 2017 21:23
Script to pasrse a kml file
<?php
$xml = simplexml_load_file('Peoples-Ranch-Map.kml-2.xml');
$folders = $xml->Document->Folder;
foreach ($folders as $folder) {
print "Name: " . $folder->name . "\n";
print "Description: " . $folder->description . "\n";
$children = $folder->children();
foreach ($children as $child) {
print ' Name: ' . $child->name . "\n";

The pull request empoji code

  • 👍 This is great!
  • ❓ I have a question / can you clarify?
  • ❌ This has to change. It’s possibly an error or strongly violates existing conventions.
  • 🔧 This is a well meant suggestion. Take it or leave it.
  • 🙃 This is a nitpick.
  • 🤔 I have some serious concerns about this particular piece of code, we should think about it/discuss it further.
  • 🤡 This is a complaint about something we don’t have an obvious answer to and that is not necessarily a problem originating from your changes.
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@bojanz
bojanz / extension-patterns.md
Last active January 14, 2023 16:59
Extension patterns: events, tagged services, plugins

This documentation is destined for drupal.org. Created first as a gist to make initial comments easier. Rewrites and clarifications welcome. Code samples are simplified for clarity. Perhaps a bit too much?

When talking about extensibility, there are several distinct use cases:

  1. Reacting to an action that has already happened.

The reaction can be anything; outputting a message, sending an email, modifying a related object, etc. Examples:

  • "A node has been saved"
  • "A product has been added to the cart".