Skip to content

Instantly share code, notes, and snippets.

View jiglesiasabio's full-sized avatar
🕶️
Testing the testing lib

Javier Iglesia Sabio jiglesiasabio

🕶️
Testing the testing lib
View GitHub Profile
@jiglesiasabio
jiglesiasabio / gist:fe097eed8ac5f14c66c0e0d54d437f60
Created August 21, 2018 14:26 — forked from johanmeiring/gist:3002458
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
{% set currentPath = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}

Keybase proof

I hereby claim:

  • I am jiglesiasabio on github.
  • I am jiglesia (https://keybase.io/jiglesia) on keybase.
  • I have a public key whose fingerprint is 4D29 613D 3353 39D8 B15A 1785 08EF 6398 098C 1361

To claim this, I am signing this object:

@jiglesiasabio
jiglesiasabio / .gitconfig
Created May 25, 2017 15:12 — forked from havvg/.gitconfig
apply PHP-CS-Fixer on all changed files in the staging area
[alias]
fix-staged = "!git diff-index --cached --name-status HEAD | grep -ve '^D' | cut -f2 | xargs -n1 php-cs-fixer fix"

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
static function generalNewsletterManagement()
{
user::needToBeLogged();
user::needToBeLevel(get_class());
@require_once 'classes/CConfig.php';
$link = CConfig::Conectar('media_new');
@jiglesiasabio
jiglesiasabio / gist:c170868b80de9551bd68
Last active August 29, 2015 14:02 — forked from charliepark/gist:4266921
Using HTML5 data attributes to store arrays
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<div id="animals" data-animals='["cat", "dog", "bird"]'></div>
<div id="vehicles" data-vehicles='{"motorcycle":"Harley", "car":"Herbie", "steamshovel":"Mike"}'></div>
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
@jiglesiasabio
jiglesiasabio / php_uppercase_example
Last active August 29, 2015 13:57
PHP Uppercasing
cadena => áéíóú ñ aeiou qwerty
strtoupper => áéíóú ñ AEIOU QWERTY
mb_convert_case => ÁÉÍÓÚ Ñ AEIOU QWERTY
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.9.deb
sudo dpkg -i elasticsearch-0.90.9.deb