Skip to content

Instantly share code, notes, and snippets.

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.

@adrienbrault
adrienbrault / extension.php
Created October 18, 2013 18:02
instanceof twig test
<?php
class LayoutExtension extends \Twig_Extension
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'yolo';
@adrienbrault
adrienbrault / guzzle.php
Created April 8, 2013 16:40
Download a file using guzzle
<?php
$client = ...;
$response = $client->get('http://guzzlephp.org/index.html', null, tmpfile())->send();
$response->getStream(); // Magic comes after
@adrienbrault
adrienbrault / keybase.md
Created January 23, 2019 14:43
keybase.md

Keybase proof

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:

@adrienbrault
adrienbrault / httpie
Last active February 2, 2018 09:24
Snippets to quickly install stuff on centos
#!/bin/bash
sudo yum install -y python-pip
sudo pip install httpie
#
@adrienbrault
adrienbrault / gist:1401812
Created November 28, 2011 20:07
Install coffee script compiler on CentOS

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
// 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])
@adrienbrault
adrienbrault / gist:7063740
Last active December 26, 2015 00:19
symfony/symfony test suite on hhvm 2.2.0
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%)
@adrienbrault
adrienbrault / 1_hateoas.md
Last active December 18, 2015 18:30
Hateoas php library features ideas/wishlist

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