Skip to content

Instantly share code, notes, and snippets.

@aimeric
aimeric / meta-tags.md
Created May 25, 2017 12:43 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@aimeric
aimeric / gist:bb1de027c11e0ce97a262116bc6f71a4
Created April 1, 2017 10:56 — forked from harrisonde/gist:90431ed357cc93e12b51
Deploy Laravel 5 applications on AWS Elastic Beanstalk
# The following script will deploy a Laravel 5 applicaion on AWS Elastic Beanstalk.
# Add to .ebextensions at the root of your application and name your commands file (e.g., commands.config)
# -------------------------------- Commands ------------------------------------
# Use "commands" key to execute commands on the EC2 instance. The commands are
# processed in alphabetical order by name, and they run before the application
# and web server are set up and the application version file is extracted.
# ------------------------------------------------------------------------------
commands:
01updateComposer:
@aimeric
aimeric / curry-with-jscookie.html
Created March 18, 2017 22:42 — forked from hitautodestruct/curry-with-jscookie.html
Allow usage of curry with js-cookie plugin
<script src="curry.min.js"></script>
<script src="js.cookie.js"></script>
<script>
var savedRate, savedCurrency;
var customCurrency = {
'USD': 1,
'COP': 2670,
};
@aimeric
aimeric / Document.php
Created February 20, 2017 20:20 — forked from beberlei/Document.php
My Symfony2 File Upload workflow
<?php
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* @Entity
*/
class Document
{
@aimeric
aimeric / jquery.ajax.progress.js
Created February 5, 2017 11:36 — forked from db/jquery.ajax.progress.js
add XHR2 progress events to jQuery.ajax
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
progress: function() { console.log("standard progress callback"); },
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function") {
req.addEventListener("progress", function(evt) {
that.progress(evt);
@aimeric
aimeric / nginx.conf
Created January 24, 2017 11:31 — forked from leon/nginx.conf
Nginx PHP-FPM Symfony 2 minimal config
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
@aimeric
aimeric / symfony2_nginx.conf
Created January 24, 2017 11:26 — forked from ZipoKing/symfony2_nginx.conf
Sample nginx configuration for Symfony2
server {
listen 80;
server_name symfony2;
root /var/www/symfony2/web;
error_log /var/log/nginx/symfony2.error.log;
access_log /var/log/nginx/symfony2.access.log;
# strip app.php/ prefix if it is present
@aimeric
aimeric / infinite-scroll.js
Created January 23, 2017 00:10 — forked from xocasdashdash/infinite-scroll.js
Simple infinite scrol with jQuery and a Symfony2 backend
is_processing = false;
last_page = false;
function addMoreElements() {
is_processing = true;
$.ajax({
type: "GET",
//FOS Routing
url: Routing.generate('route_name', {page: page}),
success: function(data) {
if (data.html.length > 0) {
@aimeric
aimeric / DefaultController.php
Created January 23, 2017 00:09
Symfony Ajax live search (autocomplete)
<?php
/* src/AppBundle/Controller/DefaultController */
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\DependencyInjection\ContainerInterface;