Skip to content

Instantly share code, notes, and snippets.

View cybernet's full-sized avatar
😇
There is not a righteous man on Earth who does what is right and never sins

cybernet cybernet

😇
There is not a righteous man on Earth who does what is right and never sins
  • /usr/sbin/mysqld
View GitHub Profile
@cybernet
cybernet / base.html.twig
Created October 22, 2020 15:38
Twig random behaviour symfony/symfony#38672
<!DOCTYPE html>
<html lang="en">
<head>
<title>{% block title %}TiTLE{% endblock %}</title>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="cybernet2u">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="{% block meta_desc %}{{ meta_desc_tag }}{% endblock %}"> {# changed as suggested #}
<meta name="keywords" content="{% block meta_keys %}{{ meta_keys }}{% endblock %}">
@cybernet
cybernet / CompanyCoverPhoto.php
Created January 8, 2020 14:19
Update CoverPhoto
<?php
/**
* @ORM\OneToOne(targetEntity="App\Entity\User", inversedBy="companyCoverPhoto", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\JoinColumn(nullable=false)
*/
private $company;
composer show phpseclib/phpseclib -a
"https://repo.packagist.org/packages.json" does not contain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
https://repo.packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
[Composer\Repository\RepositorySecurityException]
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\CaRepository")
@cybernet
cybernet / ContextualOptionsFormListener.php
Created December 7, 2018 19:30 — forked from Raphhh/ContextualOptionsFormListener.php
Symfony form: set options according to the data
<?php
namespace AppBundle\Form\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class ContextualOptionsFormListener implements EventSubscriberInterface
{
/**
@cybernet
cybernet / AgencyController.php
Created October 22, 2017 07:16
Passing data to buildForm() in Symfony 3.3
/**
* @Route("/agency/post", name="agency_post")
*/
public function agencyNewAd(Request $request)
{
// $agency = $this->get('security.token_storage')->getToken()->getUser(); ( this didn't worked .. )
$form = $this->createForm(AgencyNewAdType::class, array(
'postedBy' => $this->getUser(),
));
$form->handleRequest($request);
@cybernet
cybernet / select.sql
Created October 16, 2014 23:14
id, ch1, ch2, ch3, ch4
CREATE TABLE IF NOT EXISTS `concat` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ch1` varchar(41) NOT NULL,
`ch2` varchar(41) NOT NULL,
`ch3` varchar(41) NOT NULL,
`ch4` varchar(41) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
--
root@cnet:~# netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3750/nginx
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 1013/perl
tcp 0 0 178.157.81.119:53 0.0.0.0:* LISTEN 1179/mydns
tcp 0 0 127.0.0.2:53 0.0.0.0:* LISTEN 1179/mydns
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1179/mydns
tcp 0 0 0.0.0.0:54 0.0.0.0:* LISTEN 162/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 954/master