Skip to content

Instantly share code, notes, and snippets.

// Type definition for a list of boost::any instances.
typedef std::vector DependencyList;
// Stores all dependencies
template struct DependencyDeleter
{
// Constructor is initialized with the list of dependencies
DependencyDeleter(DependencyList dependencies) : mDependencies(dependencies)
{}
// create the dependency list
DependencyList dependencyList;
// (...gather all required dependencies and add them to the list...)
// create the plugin instance
Plugin* plugin = createPlugin();
// create a shared pointer managing the lifetime of the plugin and its dependencies
PluginPtr pluginPtr(plugin, DependencyDeleter<plugin>(dependencyList));
@xadh00m
xadh00m / BackgroundManager.java
Last active March 1, 2023 17:49
BackgroundManager
package com.android.utils;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.os.Handler;
import org.apache.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
@xadh00m
xadh00m / gist:c5ebed161b9951eb965aeaf807f65797
Created February 25, 2021 12:12
Kirby CMS JSON router config
<?php
return [
'api' => [
'allowInsecure' => true,
'basicAuth' => true
],
'languages' => true,
'routes' => [
[
'pattern' => '(:all)',