This file contains 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 | |
if (isset($_POST['rows'])) { | |
$h = tmpfile(); | |
foreach ($_POST['rows'] as $row) { | |
fputcsv($h, array_values($row)); | |
} | |
rewind($h); | |
$csv = ''; |
This file contains 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 | |
function addFolderToZip(\ZipArchive $zip, $dir) { | |
$iterator = new \RecursiveIteratorIterator( | |
new \RecursiveDirectoryIterator($dir, \RecursiveDirectoryIterator::SKIP_DOTS), | |
\RecursiveIteratorIterator::SELF_FIRST); | |
$zip->addEmptyDir(basename($dir)); | |
This file contains 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 | |
$builder = Validation::createValidatorBuilder(); | |
$builder->addYamlMapping('/path/to/validation.yml'); | |
$validator = $builder->getValidator(); | |
$extensions = array( | |
new ValidatorExtension($validator) | |
); |
This file contains 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
chmod a+w -R config/ | |
chmod a+w -R cache/ | |
chmod a+w -R log/ | |
chmod a+w -R img/ | |
chmod a+w -R mails/ | |
chmod a+w -R modules/ | |
chmod a+w -R themes/default-bootstrap/lang/ | |
chmod a+w -R themes/default-bootstrap/pdf/lang/ | |
chmod a+w -R themes/default-bootstrap/cache/ | |
chmod a+w -R translations/ |
This file contains 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 | |
$sql = '...'; | |
$stmt = $conn->prepare($sql); | |
try { | |
$stmt->execute(); | |
} catch (\Doctrine\DBAL\DBALException $e) { | |
$previous = $e->getPrevious(); |
This file contains 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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
watch: { | |
src: { | |
files: ['www/**/*.html', 'www/**/*.js', 'www/**/*.css'], | |
tasks: ['shell'] | |
} | |
}, |
This file contains 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
[xdebug] | |
zend_extension=xdebug.so | |
xdebug.overload_var_dump = 0 | |
xdebug.default_enable = 1 | |
xdebug.idekey = "sublime.xdebug" | |
xdebug.remote_autostart = 0 | |
xdebug.remote_enable = 1 | |
xdebug.remote_log="/var/log/xdebug/xdebug.log" | |
xdebug.remote_host=192.168.0.1 |
This file contains 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 | |
use Doctrine\ORM\Mapping as ORM, | |
Doctrine\ORM\Event\LifecycleEventArgs; | |
/** | |
* @ORM\Table(name="item") | |
* @ORM\HasLifecycleCallbacks | |
*/ | |
class Item |
This file contains 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 | |
$api = new Paymill\Request('private_key'); | |
function get_transactions($api, $count, $offset) { | |
$request = new Paymill\Models\Request\Transaction(); | |
// Other options here | |
$request->setFilter([ | |
'offset' => $offset, | |
'count' => $count |
This file contains 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
echo 'deb http://ftp.debian.org/debian jessie-backports main' >> /etc/apt/sources.list | |
apt-get update | |
apt-get install certbot -t jessie-backports |
OlderNewer