Skip to content

Instantly share code, notes, and snippets.

Mehdi Sakout medyo

Block or report user

Report or block medyo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
medyo /
Last active Sep 27, 2019
Solution: YouTubePlayerSupportFragment that supports androidx
* Please create this directories schema and post the file there
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
medyo / gist:fad03c9c4173e7c84f1ffae0d06f9af8
Created Sep 3, 2017 — forked from balazs-endresz/gist:f9b27514046506a7db75
Drop all tables and sequences in postgres
View gist:fad03c9c4173e7c84f1ffae0d06f9af8
# tables for owned by 'tableowner'
select 'drop table if exists "' || tablename || '" cascade;' from pg_tables where tableowner='tableowner';
# all sequences
select 'drop sequence if exists "' || relname || '" cascade;' from pg_class where relkind = 'S';
#!/usr/bin/env bash
# Dropbox Uploader
# Copyright (C) 2010-2017 Andrea Fabrizi <>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
NOW="$(date +"%Y-%m-%d")"
# Create db_backups folder if not existing
cd $OPENSHIFT_DATA_DIR && mkdir -p db_backups && cd db_backups
# Dump the postgresql database (for Mysql database, check the bottom of this page)
NOT_PRESENT="List of devices attached"
ADB_FOUND=`${ADB_PATH}/adb devices | tail -2 | head -1 | cut -f 1 | sed 's/ *$//g'`
if [[ ${ADB_FOUND} == ${NOT_PRESENT} ]]; then
echo "Make sure a device is connected"
medyo /
Last active Aug 29, 2015
Solution: Unable to execute dex: Multiple dex files

This error means that there is a duplicated library used on one or many libraries.

To fix it, we should exclude them from our dependencies. On the build.gradle add the following line

dependencies {...}
configurations {
    all*.exclude group: 'x', module: 'library'
medyo / etudiant.php
Created Jun 23, 2015
View etudiant.php
public function etudiantExistant($ca,$cin,$cne)
$q = $this->db->prepare('SELECT count(*) FROM licence WHERE ca = :ca AND cin = :cin AND cne = :cne ');
$q->bindValue(':ca', $ca);
$q->bindValue(':cin', $cin);
$q->bindValue(':cne', $cne);
$number_of_rows = $result->fetchColumn();
if ($number_of_rows > 0){
return true;
medyo /
Created May 11, 2015
It supports long tabs titles & arabic
* Copyright 2014 Google Inc. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
View gist:570355d494ced1fd8ff3

Override Devise RegistrationsController


Here I'll show you

  • How to override devise registrations_controller(related to create/update user account)
  • How to change redirect path after updating user

Override RegistrationsController

You can’t perform that action at this time.