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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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 Symfony\Component\Config\Loader\LoaderInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\HttpKernel\Kernel; | |
class AppKernel extends Kernel | |
{ |
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
{{ form_start(form) }} | |
<div class="form-group"> | |
{{form_label(form.name, "Username") }} | |
{{ form_widget(form.name, {'attr' : {'class':'form-control'}}) }} | |
</div> | |
{{ form_end(form) }} |
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
[ | |
"United States" => "us", | |
"Afghanistan" => "af", | |
"Albania" => "al", | |
"Algeria" => "dz", | |
"American Samoa" => "as", | |
"Andorra" => "ad", | |
"Angola" => "ad", | |
"Anguilla" => "ai", | |
"Antarctica" => "aq", |
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
// app/config/config.yml | |
... | |
services: | |
twig.extension.text: | |
class: Twig_Extensions_Extension_Text | |
tags: | |
- { name: twig.extension } |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>{% block title %}Welcome!{% endblock %}</title> | |
{% block stylesheets %} | |
{% stylesheets filter='cssrewrite' | |
'%kernel.root_dir%/../vendor/twbs/bootstrap/dist/css/bootstrap.css' | |
'%kernel.root_dir%/../vendor/twbs/bootstrap/dist/css/bootstrap-theme.css' | |
'@WbttcBlogBundle/Resources/public/css/custom.css' |
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 | |
namespace Webomattic\Entity; | |
class Service { | |
private $id; | |
private $service; | |
private $description; | |
private $icon; |
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 | |
try{ | |
$dbh = new PDO('mysql:host=localhost;dbname=mydb','root','root'); | |
$data = $dbh->query('SELECT * from users'); | |
$users = $data->fetchAll(PDO::FETCH_ASSOC); | |
$fp = fopen('users.csv','w'); | |
foreach($users as $line){ | |
fputcsv($fp, $line); |
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
<bean id="templateResolver" | |
class="org.thymeleaf.templateresolver.ServletContextTemplateResolver"> | |
<property name="prefix" value="/WEB-INF/views/" /> | |
<property name="suffix" value=".html" /> | |
<property name="templateMode" value="HTML5" /> | |
</bean> | |
<bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine"> | |
<property name="templateResolver" ref="templateResolver" /> | |
</bean> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee | |
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> | |
<display-name>First spring mvc application</display-name> | |
<servlet> | |
<servlet-name>dispatcher</servlet-name> | |
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
NewerOlder