Write a markdown tutorial with code examples to get started with OpenAI’s completion API in a modern symfony 5 web application with full static typing. The main example is about having GPT-3 generate a markdown tutorial.
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 | |
class LayoutExtension extends \Twig_Extension | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getName() | |
{ | |
return 'yolo'; |
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 | |
$client = ...; | |
$response = $client->get('http://guzzlephp.org/index.html', null, tmpfile())->send(); | |
$response->getStream(); // Magic comes after |
I hereby claim:
- I am adrienbrault on github.
- I am adrienbrault (https://keybase.io/adrienbrault) on keybase.
- I have a public key ASCXSSS8Y_xa0IbDKpZn5iMJC2FFh7IQDmrWjaOh1gVv7go
To claim this, I am signing this object:
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
#!/bin/bash | |
sudo yum install -y python-pip | |
sudo pip install httpie | |
# |
You are going to install some things. Login in root or use sudo for most of the followings commands.
su -
First you need git.
yum install git
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
// Go to http://www.campus-booster.net/Booster/students/classMembers.aspx | |
// Open your browser javascript console | |
// And execute this | |
var html = $('body').innerHTML | |
var regex = /http:\/\/www\.campus-booster\.net\/actorpictures\/([0-9]+)\.jpg/g | |
var ids = [] | |
while (null != (match = regex.exec(html))) { | |
ids.push(match[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
vagrant@vagrant-ubuntu-saucy-64:/vagrant/symfony$ hhvm ../phpunit/composer/bin/phpunit | |
PHPUnit 3.7.28 by Sebastian Bergmann. | |
Configuration read from /vagrant/symfony/phpunit.xml.dist | |
...........................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 59 / 11750 ( 0%) | |
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 118 / 11750 ( 1%) | |
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 177 / 11750 ( 1%) | |
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE... 236 / 11750 ( 2%) | |
..........EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.......EEEEEEEEE. 295 / 11750 ( 2%) |
I'm about to start writing a new php library for hateoas stuff. Here are my thoughts about what features it should have. If you have comments/suggestions/ideas/requests/whatever, please comment the gist.
- php 5.3 library
- hooking into the jms serializer
- support multiple hateoas "formats/standards" (hal, etc)
- configuration layer
- static configuration: php, yaml, annotations, extension api for other libraries (being cached)
- dynamic configuration, attach configuration to an object
#Integrating silex inside symfony2 full stack
It's a WIP