Skip to content

Instantly share code, notes, and snippets.

Avatar
🎃
Comiendo chaufita

KhalO KhanMaytok

🎃
Comiendo chaufita
View GitHub Profile
@Jiab77
Jiab77 / nvidia-elementaryos-loki.md
Last active Sep 13, 2022
nVidia drivers installation on ElementaryOS - Loki (ubuntu 16.04 based distrib)
View nvidia-elementaryos-loki.md

nVidia drivers installation on ElementaryOS - Loki

Introduction

ElementaryOS - Loki is an amazing ubuntu based distribution, I've just felt in love on it BUT they've removed what's required to install easily the nVidia Proprietary drivers. So here is the reason of this gist, to store the install instructions in one place inside a crystal clear documentation.

Check your device

@Glideh
Glideh / RolesType.php
Last active Apr 3, 2021
This is an example of how one could create a custom type for roles to add in a User form
View RolesType.php
<?php
namespace AdminBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;
use Symfony\Component\Security\Core\Role\Role;
@xocasdashdash
xocasdashdash / infinite-scroll.js
Created Aug 24, 2014
Simple infinite scrol with jQuery and a Symfony2 backend
View infinite-scroll.js
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) {
@brunodmt
brunodmt / OpenShiftSymfony.md
Last active Dec 1, 2016
Instalando Symfony2 en OpenShift
View OpenShiftSymfony.md

Instalando Symfony2 en OpenShift

Esta guía explica como instalar una aplicación Symfony2 existente en OpenShift.

Punto de Partida

Se asume que:

1. Creación del Gear en OpenShift

@zachleat
zachleat / reading_time.rb
Last active Oct 21, 2020
Read this in X minutes Liquid Filter Plugin (for Jekyll)
View reading_time.rb
# Outputs the reading time
# Read this in “about 4 minutes”
# Put into your _plugins dir in your Jekyll site
# Usage: Read this in about {{ page.content | reading_time }}
module ReadingTimeFilter
def reading_time( input )
words_per_minute = 180
@danvbe
danvbe / 1-Explanations.md
Last active Sep 15, 2022
A way to integrate FosUserBundle and HWIOAuthBundle
View 1-Explanations.md

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.
@jelcaf
jelcaf / Operaciones-Git
Last active Aug 17, 2022
Git Tips - Mini-trucos de Git para facilitarme la tarea
View Operaciones-Git
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas