Skip to content

Instantly share code, notes, and snippets.

@isra00
isra00 / DDC_Heading.py
Created February 28, 2022 17:58
Calibre template function for displaying the Heading of a Dewey Decimal Classification number
def evaluate(self, formatter, kwargs, mi, locals, code):
headings = {
'000': 'Generalities',
'010': 'Bibliography',
'100': 'Philosophy & psychology',
'200': 'Religion',
'300': 'Social sciences',
'400': 'Language',
'500': 'Natural sciences & mathematics',
@isra00
isra00 / adminer.css
Created May 20, 2014 15:06
"Flat" theme for Adminer (tiny mod for default CSS)
/**
* "Flat" theme for Adminer by Israel Viana.
*
* Distributed under the terms of the BSD License.
*
* Color palette from https://kuler.adobe.com/Copy-of-Flat-UI-color-theme-3785174/
* Navy: 2c3e50
* Red: e74c3c
* Gray: ecf0f1
* Light blue: 3498db
@isra00
isra00 / .gitignore
Last active April 5, 2016 13:05
Material de estudio para la certificación MySQL Developer
*~
@isra00
isra00 / wp-load.php
Created October 31, 2012 23:58
Intercepts the Wordpress bootstrap and loads one site or another depending on the domain name requested.
<?php
/**
* Bootstrap file for setting the ABSPATH constant
* and loading the wp-config.php file. The wp-config.php
* file will then load the wp-settings.php file, which
* will then set up the WordPress environment.
*
* If the wp-config.php file is not found then an error
* will be displayed asking the visitor to set up the
* wp-config.php file.
@isra00
isra00 / drupaleitor.php
Created October 28, 2012 23:36
Atomic update from git
<?php
//BEGIN CONFIG
$link_name = 'active_public_html';
$instance1 = 'public_html1';
$instance2 = 'public_html2';
define('LOG_NAME', 'drupaleitor');
define('DATADOG_APIKEY', '');
define('DATADOG_APPKEY', '');
$syslog_facility = LOG_LOCAL0; //One of http://php.net/manual/function.openlog.php
@isra00
isra00 / apc_usage.php
Created October 24, 2012 23:17
APC usage by vhost (for Plesk)
<?php
$apc_entries = apc_cache_info();
$apc_entries = $apc_entries['cache_list'];
$usage_data = array();
foreach ($apc_entries as $entry) {
$filename = $entry['filename'];