Skip to content

Instantly share code, notes, and snippets.

View Remiii's full-sized avatar
👨‍💻
remibarbe.fr

Rémi Barbe Remiii

👨‍💻
remibarbe.fr
View GitHub Profile
@elifkus
elifkus / Code.gs
Last active February 25, 2021 12:32
Google Apps Script to retrieve data from Strava into a Spreadsheet.
/**
* There is a write-up of how to get this code to run. https://elifk.us/en/retrieving-your-strava-data-with-google-app-scripts/
*/
var CLIENT_ID = '<ClientId for the Strava App>';
var CLIENT_SECRET = '<Client Secret for the Strava App>';
var SPREADSHEET_NAME = "StravaData";
var SPREADSHEET_ID = "<Spreadsheet id for the Google Spreadsheet>";
var SHEET_NAME = "Sheet1";
var DEBUG = false;
@Remiii
Remiii / README.md
Last active February 26, 2021 08:36
Doctrine (Symfony) DB mapping - Relation Mapping

Doctrine (Symfony) DB mapping

OneToOne (1=>1)

Sample: Category and Product

// src/Acme/StoreBundle/Entity/Category.php

// ...
Based on your issues in installing ncdu my recommendation would be to use du and sort on together.
For instance:
du /home | sort -rn (will search all files/directories under /home and sort them by largest to smallest.
du -h /home | sort -rh (same but will show it in MB/KB/etc) - Note this requires coreutils 7.5 or newer (sort --version to check)
You can replace /home with any directory of your choice.
@lologhi
lologhi / Install elasticsearch on Ubuntu 14.04.md
Last active August 29, 2015 14:05
Install elasticsearch on Ubuntu 14.04

## Install Java

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

## Install elasticsearch

@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

@lologhi
lologhi / Apply fixtures on Doctrine entities with ManyToMany relations.md
Last active April 29, 2017 14:25
Apply fixtures on Doctrine entities with ManyToMany relations

Club entity

/**
 * @ORM\ManyToMany(targetEntity="Field", inversedBy="clubs")
 */
private $fields;

Field entity

@Remiii
Remiii / README.md
Created August 16, 2014 17:24
Hubot on OSX

Hubot on OSX

Install

$ brew update
$ brew upgrade
$ brew install redis

$ npm install -g hubot coffee-script
@jnankin
jnankin / gist:66829583bbcd9d16bb61
Last active June 19, 2020 01:16
casperJS unit test file for checking site for 404s and 500s
/**
* This casper unit test script checks for 404 internal links for a given root url.
*
* Adapted from: https://gist.github.com/n1k0/4509789
* Usage:
*
* $ casperjs test 404checker.js --includes=URI.js
*/

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.
@brianfernalld
brianfernalld / gist:c0351bf195797242a4bd
Created May 7, 2014 22:49
Hubot Script - Carlton.coffee
# Description:
# Carlton Celebration
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands: