Skip to content

Instantly share code, notes, and snippets.

View Daveiano's full-sized avatar
🏠
Working from home

Daveiano

🏠
Working from home
View GitHub Profile
@Daveiano
Daveiano / commandline.py
Created May 1, 2023 09:39 — forked from opie4624/commandline.py
Base Python Command Line template
#!/usr/bin/env python
#
# import modules used here -- sys is a very standard one
import sys, argparse, logging
# Gather our code in a main() function
def main(args, loglevel):
logging.basicConfig(format="%(levelname)s: %(message)s", level=loglevel)
@Daveiano
Daveiano / SubRequestController.php
Last active February 28, 2020 21:24 — forked from dmouse/SubRequestController.php
Drupal 8: how to create a sub-request
<?php
namespace Drupal\content_helper\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
/**