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 / 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 / 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;
@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(
<?php
$api = new CSApi($public_key, $private_key);
$res = $api->check_authentication('e@mail.com', 'clave');
if ($api->has_errors) {
echo "$api->last_error.\n";
} else {
if ($res == 0) {
@Gazer
Gazer / MyModel.rb
Created May 31, 2011 21:44
URL for models in JSON Response
class MyModel
attr_accessor :item_url
def as_json(options={})
{
:url => item_url
}.merge(self.attributes)
end
end
void
setup_language_manager_path(GtkSourceLanguageManager *lm)
{
gchar **lang_files;
int i, lang_files_count;
char **new_langs;
lang_files = g_strdupv (gtk_source_language_manager_get_search_path (lm));
lang_files_count = g_strv_length (lang_files);
<VirtualHost *:80>
<Directory "/xxx/yyy/zzz/falta-uno/current/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ServerAdmin mimail@midominio.com
DocumentRoot /xxx/yyy/zzz/falta-uno/current/public
class User
def full_name
"BLA"
end
alias :full_name, :real_full_name
def full_name
@cache ||= real_full_name
end
end