Skip to content

Instantly share code, notes, and snippets.

View kklecho's full-sized avatar

Krzysztof Lechowski kklecho

  • Dublin, Ireland
View GitHub Profile
@kklecho
kklecho / wsl_git
Created December 7, 2021 23:00
wsl git Operation Not Permitted
sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata
source: https://askubuntu.com/questions/1115564/wsl-ubuntu-distro-how-to-solve-operation-not-permitted-on-cloning-repository
# https://developer.okta.com/blog/2018/06/14/php-crud-app-symfony-vue
# https://bootstrap-vue.js.org/docs/components/pagination/
#console1
mkdir -p ~/Project/movb
cd ~/Project/movb
symfony new movb-server --version=lts
composer require sensio/framework-extra-bundle
composer require symfony/orm-pack
composer require symfony/maker-bundle --dev
# npm perm issues when instaling packages globally,
# src: https://stackoverflow.com/questions/33725639/npm-install-g-less-does-not-work
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile
source ~/.profile
# try:
npm install -g @vue/cli
#install
composer require symfony/http-client
#use
use Symfony\Component\HttpClient\HttpClient;
$client = HttpClient::create();
$response = $client->request('GET', 'https://api.github.com/repos/symfony/symfony-docs');
$statusCode = $response->getStatusCode();
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class HomeController extends AbstractController
{
/**
Encore
#...
.enableVueLoader()
#...
{% extends 'base.html.twig' %}
{% block title %}Home page{% endblock %}
{% block body %}
<div ref="words" data-words="{{ words|join(',') }}">
</div>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
</head>
<body>
#assets/js/components/App.vue
<template>
<div>
<h2 class="center">My Application</h2>
<div v-text="message"></div>
{{ message }}
<ul>
<li :key="word.id" v-for="word in words">{{ word }}</li>
</ul>
</div>
import Vue from 'vue';
import App from './components/App';
new Vue({
el: '#app',
render: h => h(App)
});