Skip to content

Instantly share code, notes, and snippets.

View redleafar's full-sized avatar
🎯
Focusing

Rafael Bermúdez redleafar

🎯
Focusing
  • Globant
  • Bogotá, Colombia
View GitHub Profile
@redleafar
redleafar / add_footer_navigation_drawer.md
Created February 25, 2017 01:17
Add footer to NavigationDrawer
@redleafar
redleafar / composer_php_override_error.md
Created September 18, 2016 19:33
Your PHP version (5.6.18) overriden by “config.platform.php” version (5.3.9) does not satisfy requirement

Look in composer for:

"config": {
   "preferred-install": "dist",
   "platform": {
       "php": "5.3.9"
   }
}
@redleafar
redleafar / font_side_menu.md
Last active February 28, 2021 22:09
How to set font of side menu (navigation view) items

Set font of side menu items

Create this class:

import android.graphics.Paint;
import android.graphics.Typeface;
import android.text.TextPaint;
import android.text.style.TypefaceSpan;
@redleafar
redleafar / Problem_mysql_mac.md
Created January 29, 2019 18:04
Problems with MySql in Mac
@redleafar
redleafar / composer_error_memory_exhausted.md
Created February 12, 2018 18:49
Composer error: Fatal error: Allowed memory size of ... bytes exhausted

This happens when trying to install a new dependency and there is not enough memory, so you can raise the memory (in this case to 3GB) temporarily using :

php -d memory_limit=3G C:\ProgramData\ComposerSetup\bin\composer.phar require  excelwebzone/r

Check the actual memory limit with:

php -r "echo ini_get('memory_limit').PHP_EOL;"
@redleafar
redleafar / custom_query_sonata_type_model.md
Created October 24, 2016 00:44
Custom query for sonata_type_model
protected function configureFormFields(FormMapper $formMapper)
{
    $em = $this->modelManager->getEntityManager('MyBundle\Entity\Categoria');

    $query = $em->createQuery('SELECT b FROM MyBundle:Categoria b WHERE b.name = :name');
	
    $query->setParameter('name', 'name_of_categoria');
    
 $formMapper
@redleafar
redleafar / format_data_from_server_in_java.md
Created February 12, 2018 18:50
Format date from server in java
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
@redleafar
redleafar / strange_characters_cmd.md
Created February 12, 2018 18:48
Strange characters in CMD

https://stackoverflow.com/questions/35387667/git-bash-is-displaying-strange-characters-on-windows-7

Having used git on windows for over three years now, I’ve fallen back in love with the command line. Bash, of course, not the windows command prompt. Beautiful, ubiquitous, warty bash. Git depends heavily on GNU utilities so on Windows it requires either cygwin or msys. Having been burned by cygwin in the past, I prefer the minimalism and simplicity of msys + mingw. Along with git, the entire ruby ecosystem lives in the shell. However, the numerous tools, gems and utilities that assume standard ANSI color support in the shell began to wear on me. Lo and behold, there is a lovely solution to provide ansi color support for bash (and cmd) on Windows: ansicon.

Download the zip and extract (https://github.com/adoxa/ansicon/downloads). There are a few ways to install:

Extract to a permanent location (I use C:/bin/ansicon). Execute ansicon.exe -i from within the appropriate directory for your system (x86/x64),