PHP´s magic ::class
-constant will not canonical the casing of your imports.
This can lead to hard to debug errors when you a using a case sensitive service PSR-11
-locator like Zend\ServiceManager
.
namespace FirstNamespace;
class TestClass {}
## See: https://serverfault.com/a/915845/17736 | |
FROM percona/percona-server:5.7 as builder | |
USER root | |
RUN mkdir -p /initialized-db && chown -R mysql:mysql /initialized-db | |
# That file does the DB initialization but also runs mysql daemon, by removing the last line it will only init | |
RUN ["sed", "-i", "s/exec \"$@\"/echo \"not running $@\"/", "/docker-entrypoint.sh"] |
#!/usr/bin/bash | |
## extract once using https://github.com/inAudible-NG/audible-activator | |
activationBytes="" | |
for m in *.aax; do | |
basename=${m%.aax} | |
# extract audio stream | |
ffmpeg -activation_bytes $activationBytes -i ${basename}.aax -vn -c:a copy ${basename}.m4a | |
# extract thumbnail | |
ffmpeg -activation_bytes $activationBytes -i ${basename}.aax -an -vcodec copy ${basename}.jpg |
<?php | |
/** | |
* https://twitter.com/Ocramius/status/959405445260726272 | |
* only ever return implementations of an interface as an | |
* anonymous class coming from a factory. | |
*/ | |
namespace Example; |
<?php | |
$password = 'My Plaintext Password'; | |
$plaintext = 'This is my message'; | |
$secretBox = new Secretbox(); | |
$ciphertext = $secretBox->encrypt($plaintext, $password); | |
$decryptedPlaintext = $secretBox->decrypt($ciphertext, $password); | |
assertThat($decryptedPlaintext === $plaintext, 'Can decrypt'); |
PHP´s magic ::class
-constant will not canonical the casing of your imports.
This can lead to hard to debug errors when you a using a case sensitive service PSR-11
-locator like Zend\ServiceManager
.
namespace FirstNamespace;
class TestClass {}
<?php | |
// see https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata | |
namespace PHPSTORM_META { | |
override(\Doctrine\ORM\EntityManager::find(0), map([ | |
'' => '@', | |
])); | |
override(\Interop\Container\ContainerInterface::get(0), map([ | |
'' => '@', |
<?php | |
$fizzers = [1, 0, 0, 0]; | |
$buzzers = [2, 0, 0, 0, 0]; | |
$words = ['', 'Fizz', 'Buzz', 'FizzBuzz']; | |
foreach (range(1, 100) as $i) { | |
$words[0] = $i; | |
echo $words[$fizzers[$i % 3] + $buzzers[$i % 5]].PHP_EOL; | |
} |
FROM debian:jessie | |
MAINTAINER Jacob Alberty <[email protected]> | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN echo "deb http://www.ubnt.com/downloads/unifi/debian unifi5 ubiquiti" > \ | |
/etc/apt/sources.list.d/20ubiquiti.list && \ | |
echo "deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen" > \ | |
/etc/apt/sources.list.d/21mongodb.list && \ | |
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" > \ |
#!/usr/bin/env bash | |
# | |
# Converts .htaccess files to vhost directory directives | |
# | |
# http://httpd.apache.org/docs/2.4/howto/htaccess.html#when | |
# You should avoid using .htaccess files completely if you have | |
# access to httpd main server config file. Using .htaccess files | |
# slows down your Apache http server. Any directive that you can | |
# include in a .htaccess file is better set in a Directory block, | |
# as it will have the same effect with better performance. |
I hereby claim:
To claim this, I am signing this object: