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 / 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"
super.onViewCreated(view, savedInstanceState);
ButterKnife.inject(this, view);
callbackManager = CallbackManager.Factory.create();
facebookLoginButton.setFragment(this);
facebookLoginButton.registerCallback(callbackManager, presenter);
presenter.bindView(this);
@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;
// 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 / 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
@Gazer
Gazer / MainActivity.groovy
Created December 29, 2014 16:23
Groovy on Android
@CompileStatic
public class MainActivity extends ActionBarActivity {
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.text) as TextView;
@Gazer
Gazer / clean_noise.sh
Created May 28, 2014 03:25
Noise Removal using avconv and sox
#!/bin/sh
# Tested with :
# * avconv version 9.13-6:9.13-0ubuntu0.14.04.1,
# * SoX v14.4.1
#
# Just run clean.sh input_file.mp4 output_file.mp4
INPUT=$1
OUTPUT=$2
@Gazer
Gazer / distance.ino
Created January 31, 2014 22:27
Ejemplo sensor ultrasónico HC-SR04 con Arduino y NewPing
#include <NewPing.h>
#define trigPin 2
#define echoPin 4
NewPing sonar(trigPin, echoPin, 800);
void setup() {
Serial.begin(9600);
}
@Gazer
Gazer / localhost.conf
Last active October 20, 2021 14:55
Nginx example to redirect users to a "Comming soon portal" if they are not developers.
server {
listen 80;
server_name localhost;
location @until {
# Static "comming soon" directory with index.html and assets
root /var/www/;
index index.html;
}
@Gazer
Gazer / index.php
Created April 10, 2013 21:00
Refactoring a SlimFramework-based app for fun & profit
<?php
get('/', function () {
$contacts = ORM::for_table('contact')->find_many();
render('home.php', array('contacts' => $contacts));
});
get('/contacts/new', function () {
render('contacts/form.php', array(