Skip to content

Instantly share code, notes, and snippets.

jose heriberto perez magaña heridev

Block or report user

Report or block heridev

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
@heridev
heridev / exceptions.md
Last active Aug 11, 2018
Refactoring the app into MVP : Fourth part - Exceptions
View exceptions.md

Let's start changing the repository to trigger an exception(typo in the orderby clause):

DatabaseBooksRepository.java

public class DatabaseBooksRepository implements BooksRepository {
  private final DatabaseHelper databaseHelper;
  public DatabaseBooksRepository(Content context) {
   databaseHelper = OpenHelperManager.getHelper(context, DatabaseHelper.class);
  }
@heridev
heridev / third_part.md
Created Aug 11, 2018
Refactoring the app into MVP : Third part - Using Mockito
View third_part.md

Seems to be pretty simple to install so now let's start with some examples with the same BooksActivityPresenterTest

BooksActivityPresenterTest.java

import org.junit.Test;
import org.junit.Asserts;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
@heridev
heridev / second_part.md
Last active Aug 11, 2018
Refactoring the app into MVP : Second part
View second_part.md

Implementing the database thing

OpenHelperManager.java

/* this is not the complete example for the implementation
 but it is just a sample as I didn't write it all that
*/
public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
  private static final String DATABASE_NAME="Sniptit.rb";
@heridev
heridev / first_part.md
Last active Aug 11, 2018
Refactoring the app into MVP : First part
View first_part.md
@heridev
heridev / news.md
Created Mar 21, 2018
retirar cuyutlan, cuyutlan caseta, backup noticia cuyutlan
View news.md

15 marzo, 2018

Pueden seguir tomando casetas, pero es como querer curar un cáncer con aspirinas Reciente concesión fue en absoluta discreción, convirtiendo un asunto público en privado La caseta Cuyutlán sí debe ser retirada y la concesión no debió haberse ampliado “Quod scripsi, scripsi”, columna de Horacio Archundia No se trata de tomar casetas y liberar el paso en ellas; porque si bien la medida beneficia a quienes durante las horas de la toma transitan por la autopista, la verdad es que no se combate el problema que tiene, al final de cuentas, una solución legal.

Sí es posible el desmonte de todas las casetas de la autopista Guadalajara-Manzanillo. Pero esto tiene que hacerse por la vía legal y también es una decisión que debe responderse con prontitud por las instancias jurídicas correspondientes.

@heridev
heridev / Unix Command
Last active Jun 27, 2017 — forked from vaquarkhan/Unix Command
most common unix command for development
View Unix Command
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
#####################################################
@heridev
heridev / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@heridev
heridev / capybara cheat sheet
Last active Aug 29, 2015 — forked from zhengjia/capybara cheat sheet
capybara cheat sheets
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@heridev
heridev / gist:637009ed5df0e52ab939
Last active Nov 17, 2015 — forked from neddenriep/gist:8484466
How to implement google tag manager in Spree
View gist:637009ed5df0e52ab939

Create a new override file to add the google tag manager partial into the main spree_application layout

where "add_google_tag_manager" can be whatever name you want.

app/overrides/spree/layouts/spree_application/add_google_tag_manager.html.erb.deface

The content for the override is:

<!-- insert_after '.container' -->
<%= render :partial => 'spree/shared/google_tag_manager'%>
@heridev
heridev / gist:5733b5ea01995142f57b
Last active Aug 29, 2015
Problema con la api routes
View gist:5733b5ea01995142f57b
# si deseas utilizar el codigo que adjuntas que es el siguiente
class Api::ResponsesController < ApplicationController
respond_to :json
def index
json_response = {
models: "hola"
}
respond_with json_response
end
You can’t perform that action at this time.