Skip to content

Instantly share code, notes, and snippets.

Jose Miguel Gallas Olmedo josemigallas

  • Red Hat
  • Málaga, Spain
Block or report user

Report or block josemigallas

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
@josemigallas
josemigallas / i18n.js (mocked)
Created Jan 16, 2019
Gist exemplifying usage of Jest module mocks, with Flow.
View i18n.js (mocked)
// modules/__mocks__/i18n.js
const i18n = {
t: name => `Bye ${name}!`
}
export default i18n
@josemigallas
josemigallas / LoadingDialog.java
Created Oct 5, 2017
Very cool dialog that blocks the screen, to be used during some asynchronous process preventing user from interacting with the screen.
View LoadingDialog.java
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
public class LoadingDialog extends DialogFragment {
private static final String ARG_TITLE = "TITLE";
View android-benchmark-devices.csv
We can't make this file beautiful and searchable because it's too large.
#VARIANT ID,TOKEN ALIAS,TOKEN ID
57167989-2e1f-47b6-9a14-cd7c6667f057,c69432c1-2eb8-4f12-86da-be59812dc4f1,f6432ef3-dc99-4f1d-a128-f5f44a3e67a7
57167989-2e1f-47b6-9a14-cd7c6667f057,42aacc11-337b-4771-b134-f49888e8af8d,220b1298-ca36-4041-abcf-2d46fafeeccf
57167989-2e1f-47b6-9a14-cd7c6667f057,3773015b-848b-421d-8ace-92950fb0bc3c,5e7ae44c-cb11-4984-bad1-c0cf78202298
57167989-2e1f-47b6-9a14-cd7c6667f057,8231e289-8216-4680-b02e-020e6d9cb5a4,e745ddd0-3e83-4db7-a968-98eadf2ef271
57167989-2e1f-47b6-9a14-cd7c6667f057,e8185ffb-1948-48dc-8bac-1dfff78807cf,851081bd-6939-4400-b745-c5ea875c3603
57167989-2e1f-47b6-9a14-cd7c6667f057,93277b7b-db59-489f-bb54-aa25941192cb,e0fd3643-882f-41a0-87fe-3920d985a1ad
57167989-2e1f-47b6-9a14-cd7c6667f057,3644e018-6af2-4885-ab44-60127431ecf1,285951f1-170f-43ca-a3f4-499663eb44a8
57167989-2e1f-47b6-9a14-cd7c6667f057,aa6d087a-9676-4fe4-8d42-f1f1a146b0ac,6cb5ec8e-6af6-4995-83d4-b14512122a8b
@josemigallas
josemigallas / git-clone.py
Last active Jun 12, 2017
This script clones a repository from Github, previously forked, and add both remotes origin and upstream, renaming origin with your username.
View git-clone.py
#!/usr/bin/python
import sys
from os.path import splitext, basename
from os import system
import re
# Verify arguments
try:
urlForked = sys.argv[1]
@josemigallas
josemigallas / git-clone.sh
Last active Jun 12, 2017
Script that clones a repository and adds both remotes origin and upstream, renaming origin with a definde username.
View git-clone.sh
#!/bin/bash
# Definitions
GITHUB_USER=josemigallas
# Verify arguments
if [ -z "$1" ] || [ -z "$2"]; then
echo "Missing forked and upstream repos' urls.
Usage: git-clone <origin> <upstream>"
exit 0
View Start Up WireMock
# Create a folder for WireMock stuff
mkdir wiremock;
cd wiremock;
# Download de standalone version
wget http://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/2.4.1/wiremock-standalone-2.4.1.jar;
# Create mappings
mkdir mappings;
echo '{ "request": { "url": "/", "method": "GET" }, "response": { "status": 200, "fixedDelayMilliseconds": 500, "body": "Hello WireMock!\n" }}' > mappings/hellofi.json;
View CropableTextureView
public class CroppableTextureView extends TextureView implements TextureView.SurfaceTextureListener {
private final int videoRes;
private MediaPlayer player;
private int videoHeight;
private int videoWidth;
public CroppableTextureView(Context context, AttributeSet attrs) {
super(context, attrs);
@josemigallas
josemigallas / ReducedBitmapFactory.java
Last active Jun 8, 2016
Class for decoding a bitmap from a file
View ReducedBitmapFactory.java
public class ReducedBitmapFactory {
public static final int MAX_IMAGE_WIDTH = 1200;
public static final int MAX_IMAGE_HEIGHT = 1200;
public static Bitmap decodeFile(String photoPath) {
BitmapFactory.Options bmOptions = new android.graphics.BitmapFactory.Options();
bmOptions.inJustDecodeBounds = true;
BitmapFactory.decodeFile(photoPath, bmOptions);
You can’t perform that action at this time.