Skip to content

Instantly share code, notes, and snippets.

View moizest89's full-sized avatar
🎯
Focusing

Moises Portillo moizest89

🎯
Focusing
View GitHub Profile
@moizest89
moizest89 / data.js
Created December 27, 2018 13:44
Pokemon basic filte
loadAllPokemon() //When the web page is finish to load, the first function to load is this one
// const allPokemon = pokemon["pokemon"]
function loadAllPokemon() {
const allPokemon = pokemon["pokemon"]
renderPokemonListInvView( allPokemon )
}
@moizest89
moizest89 / DialogBuilder.kt
Created November 15, 2018 21:03 — forked from ilkinulas/DialogBuilder.kt
Kotlin Builder Pattern
class Dialog private constructor(
val title: String,
val message: String,
val titleColor: Color,
val bodyColor: Color,
val icon: Image,
val onClose: () -> Unit) {
fun show() {
//...
@moizest89
moizest89 / CreateInstrument.java
Created July 5, 2018 03:02
Permite registrar la ejecución instrumento, debe proporcionarse el id de instrumento, la fecha de ejecución y las respuestas.
D/OkHttp: --> POST http://www.fedisal.org.sv:8081/OV/rest/instrumentos/create
D/OkHttp: Content-Type: application/json; charset=UTF-8
D/OkHttp: Content-Length: 269
D/OkHttp: BodyRequest: {"fecha":"14/02/2018 05:14:53","instrumento":"1","respuestas":[{"comentario":"","valor":"2","variable":"G1"},{"comentario":"","valor":"3","variable":"G2"},{"comentario":"","valor":"2","variable":"G3"},{"comentario":"El Salvador","valor":"El Salvador","variable":"G4"}]}
D/OkHttp: --> END POST (269-byte body)
D/OkHttp: <-- 200 OK http://www.fedisal.org.sv:8081/OV/rest/instrumentos/create (344ms)
D/OkHttp: X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.1.2.2 Java/Oracle Corporation/1.7)
D/OkHttp: Server: GlassFish Server Open Source Edition 3.1.2.2
D/OkHttp: Content-Type: application/json;charset=iso-8859-1
D/OkHttp: Transfer-Encoding: chunked
@moizest89
moizest89 / FragmentUtils.java
Created May 22, 2018 22:36 — forked from amilcar-sr/FragmentUtils.java
Utility class that helps with fragment manipulation
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
/**
* Utility class that helps with fragment manipulation.
*/
public class FragmentUtils {
/**
public class DataManager {
public void getArticles(final DataManagerCallBacks dataManagerCallBacks){
Call<UserResponse> call = this.apiService.getArticlesList();
call.enqueue(new Callback<UserResponse>() {
@Override
public void onResponse(Call<UserResponse> call, Response<UserResponse> response) {
if(response.isSuccessful()){
@moizest89
moizest89 / Activity.java
Created November 30, 2016 01:20
Easy OnItemClickListener implementation into RecyclerView
Adapter mAdapter = new Adapter();
mAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClickListener(View view, int position) {
//To-do something
}
});
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Address;
var menu_responsive = {
evaluate_menu:function(){
console.log("evaluate_menu")
if(state_menu_responsive == 0){
this.open_menu();
}else if(state_menu_responsive == 1){
this.close_menu();
}
},
private AQuery aq;
private Bitmap preset;
@Override
protected void onCreate(Bundle savedInstanceState) {
this.aq= new AQuery(this.context);
this.preset= aq.getCachedImage(R.drawable.placeholder_slider); //Holder para que cargen las imagenes
}