Skip to content

Instantly share code, notes, and snippets.

View Gazer's full-sized avatar
💭
Coding

Ricardo Markiewicz Gazer

💭
Coding
View GitHub Profile
@Gazer
Gazer / gist:c0c002c25b1fc302674c
Created December 29, 2014 17:46
Charset name problem
Log.d("Charset", "toString() : " + CharsetToolkit.getDefaultSystemCharset().toString());
Log.d("Charset", "displayName() : " + CharsetToolkit.getDefaultSystemCharset().displayName());
Log.d("Charset", "name() : " + CharsetToolkit.getDefaultSystemCharset().name());
Output :
D/Charset﹕ toString() : java.nio.charset.CharsetICU[UTF-8]
D/Charset﹕ displayName() : UTF-8
D/Charset﹕ name() : UTF-8
// Creates a copy of the git tree into target directory to be included on the final EAR
// Use zipfileset(dir: "${warDest}/src", prefix: 'src') on your ant.ear task.
target(generateSourceCode: "Generates a src copy") {
depends(defineContextRoot)
ProcessBuilder ps=new ProcessBuilder("/usr/bin/git", "ls-tree", "--name-only", "-r", "HEAD");
def dir = "${projectTargetDir}/src"
new File(dir).mkdirs();
@Gazer
Gazer / FragmentMVP.java
Created December 24, 2015 06:02
Comparación Android Normal vs Android MVP
package it.patagonian.argentinamecopa.fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
super.onViewCreated(view, savedInstanceState);
ButterKnife.inject(this, view);
callbackManager = CallbackManager.Factory.create();
facebookLoginButton.setFragment(this);
facebookLoginButton.registerCallback(callbackManager, presenter);
presenter.bindView(this);
@Gazer
Gazer / 0_README.md
Last active January 6, 2016 13:45
Gradle tasks for code static code analysis on android apps.

Gradle Tasks for code static code analysis on android apps.

Credits to : https://github.com/artem-zinnatullin/qualitymatters

Usage :

  • Download all files on this GIST.
  • Put the XML files on your root directory under code_quality_tools/ folder.
  • Put the code_quality_tools.gradle file into your root project directory.
  • On each module you want to check add to the build.gradle the next line : apply from: '../code_quality_tools.gradle'
  • Run "gradlew check"
@Gazer
Gazer / PagerIndicator.java
Created September 19, 2016 11:53
A simple Page indicator for Android ViewPager
package com.example;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.os.Build;
import android.support.v4.view.ViewPager;
@Gazer
Gazer / demo.dart
Created April 25, 2019 17:57
SliderWidget API
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SliderWidget(
icon: Icons.arrow_forward,
text: "Deslizá para transferir",
color: Colors.red,
onSubmit: (Function onFinish, Function onError) async {
await pause(const Duration(seconds: 1));
@Gazer
Gazer / example.dart
Created February 4, 2020 03:12
Flutter Stack Example
class TestWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(24.0),
child: AspectRatio(
aspectRatio: 3 / 2.0,
child: LayoutBuilder(
builder: (context, BoxConstraints constraints) {
return Stack(
@Gazer
Gazer / firebase-function-mercadopago.js
Created April 27, 2020 16:30
Create a MercadoPago Preference when a document is created in Firestore
const functions = require('firebase-functions');
const admin = require('firebase-admin');
let FieldValue = require('firebase-admin').firestore.FieldValue;
admin.initializeApp();
const db = admin.firestore();
const express = require('express');
const app = express();
const mercadopago = require('mercadopago');
@Gazer
Gazer / main.dart
Created May 20, 2020 23:45
Parse Youtube URL to get YoutubeID
// Parse Youtube URL to get YoutubeID
//
void main() {
var url = "https://www.youtube.com/watch?v=xr3pKzqrv70";
var uri = Uri.parse(url);
var v = uri.queryParameters['v'];
print("v=$v");
}