Skip to content

Instantly share code, notes, and snippets.

View julienbourdeau's full-sized avatar
🏠
Working from home

Julien Bourdeau julienbourdeau

🏠
Working from home
View GitHub Profile
@julienbourdeau
julienbourdeau / app.yml.md
Created September 16, 2018 18:04
Discourse config for outter Nginx (run other websites next to Discourse)
## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/forum.allraces.org/before/*;

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name forum.allraces.org;
    root /home/forge/forum.allraces.org/; # /!\ UPDATE WITH YOUR DOMAIN

Customizing records

All models are converted via the Symfony Serializer component. The bundle also support the popular JMS Serializer bundle.

There are 3 main ways:

  • Use annotations in entity (Not the most powerful but very simple)
  • Write custom normalize method in entity
  • Write custom EntityNormalizer class
@julienbourdeau
julienbourdeau / UserAgent.md
Last active July 18, 2018 23:49
Algolia UserAgents

Algolia UserAgent

The User-Agent should be a semi-colon separated list, where the version is in parenthesis.

For simplicity, the User-Agent should:

  1. start with the API Client version,
  2. followed by language/plateform version,
  3. then every integration can add whatever they want
@julienbourdeau
julienbourdeau / install.bash
Created May 21, 2018 11:20 — forked from val-bubbleflat/install.bash
Install V8Js on Laravel Forge
sudo add-apt-repository ppa:pinepain/libv8-5.2
sudo apt-get update
sudo apt-get install libv8-5.2
sudo pecl install v8js
sudo su
echo "extension=v8js.so" >> /etc/php/7.1/fpm/php.ini
echo "extension=v8js.so" >> /etc/php/7.1/cli/php.ini
exit
sudo service nginx restart && sudo service php7.1-fpm restart

I recently got a new Macbook Pro and wanted to document how I setup my PHP environment. I like full control of how PHP is built and I usually build it from source. I do this because I often add custom extensions and modules not found in the common PHP OSX installers. If your looking for a easier method than building from source try https://php-osx.liip.ch/.

NOTE: This post assumes you are running a fresh install of MacOS Sierra 10.12.16 with System Integrity Protection disabled. If you don't know how to disable it just boot into recovery mode and open a terminal and type csrutil disable, or google search it :) This post also assumes you are using Zsh instead of Bash shell. If you are using Bash you can replace anytime you see ~/.zshrc with ~/.bashrc.

First lets get some of the prerequisites. Start by grabbing the command line tools neccessary:

xcode-select --install
@julienbourdeau
julienbourdeau / data.json
Created April 16, 2018 10:15
App data set for Algolia
[
{
"category": "Books",
"name": "iBooks",
"image_ok": false,
"image": "http://is1.mzstatic.com/image/thumb/Purple62/v4/d3/84/38/d38438a5-6cb4-bad5-72c1-64da79f2c200/source/175x175bb.jpg",
"rank": 1,
"link": "http://itunes.apple.com/us/app/ibooks/id364709193?mt=8",
"image_updated": true
},
@julienbourdeau
julienbourdeau / Post.php
Last active June 28, 2023 23:33
Symfony Post entity for Algolia's documentation
<?php
/*
* This file is part of the Symfony/demo project
* https://github.com/symfony/demo
*
*/
namespace App\Entity;
@julienbourdeau
julienbourdeau / windows_keys_like_osx.ahk
Created November 3, 2017 10:18 — forked from levelsio/windows_keys_like_osx.ahk
Make Bootcamp Windows keys act like OSX
; Make Bootcamp Windows keys act like OSX
; by @levelsio
;
; 2017-11-02
;
; Licensed as GPL
;
; Use autohotkey.com to load this file on Windows
;
; This fixes Cmd+Tab to work like Alt+Tab, also keys like Cmd+C as Ctrl+C etc., Cmd+Q to Alt-F4