This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* module/Application/src/Application/I18n/DummyTranslator.php */ | |
namespace Application\I18n; | |
use Zend\I18n\Exception; | |
use Zend\I18n\Translator\Translator; | |
class DummyTranslator extends Translator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Attach XhrTerminalViewModelListener in module's onBootstrap() method. | |
* | |
* <code> | |
* public function onBootstrap(MvcEvent $e) | |
* { | |
* $app = $e->getApplication(); | |
* $eventManager = $app->getEventManager(); | |
* $eventManager->attach(new XhrTerminalViewModelListener()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
//# sourceURL=dynamic_script.js | |
// use above annotation to display content of script tag | |
// as file dynamic_script.js in Chromium's Sources tab. | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Detect if ClickOnce is (or rather: might be) supported by the browser. | |
This is partly based on https://gist.github.com/adunkman/2371101. | |
If the userAgent string does not contain a .NET feature hint, | |
we settle for everything that looks like an IE, because .NET | |
is installed nearly everywhere nowadays. | |
It might also be a good idea to check for the X-ClickOnceSupport | |
header on the server side. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://stackoverflow.com/a/246128 | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done | |
BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import socket | |
import ssl | |
import datetime | |
# based on https://serverlesscode.com/post/ssl-expiration-alerts-with-lambda/ | |
# | |
# Usage: check_ssl_expiry.py <hostname> [port] [gracetime_days] | |
# port Port to check (defaults to 443) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zone "blacklisted.domain" {type master; file "/etc/bind/blockeddomains.db";}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function embedInCData($str) | |
{ | |
$dom = new \DOMDocument(); | |
$cdata = $dom->createCDATASection($str); | |
return $dom->saveXML($cdata); | |
} | |
// usage: | |
echo embedInCData('<strong>foobar</strong>'); | |
// <![CDATA[<strong>foobar</strong>]]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Secenario: running Kodi and MPD. Kodi should output sound via HDMI, | |
MPD should use the 3.5mm jack. | |
aplay -l lists available devices: | |
**** List of PLAYBACK Hardware Devices **** | |
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA] | |
Subdevices: 7/8 | |
Subdevice #0: subdevice #0 | |
Subdevice #1: subdevice #1 |
OlderNewer