Skip to content

Instantly share code, notes, and snippets.

View cesarferreira's full-sized avatar

César Ferreira cesarferreira

View GitHub Profile
@cesarferreira
cesarferreira / Readme.md
Created December 22, 2015 15:44 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@cesarferreira
cesarferreira / DataWebService.java
Last active December 22, 2015 15:43 — forked from lopspower/1-README.md
Retrofit Introduction
import retrofit.Call;
import retrofit.http.GET;
/**
* Copyright (C) 2016 Mikhael LOPEZ
* Licensed under the Apache License Version 2.0
* Example Data WebService
* Created by Mikhael LOPEZ on 18/12/2015.
*/
public interface DataWebService {
@cesarferreira
cesarferreira / .travis.yml
Created November 9, 2015 19:35 — forked from mariotaku/.travis.yml
Sign and upload compiled apk to Github releases automatically using Travis CI
language: android
android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
- platform-tools
- tools
# The BuildTools version used by your project
- build-tools-22.0.0
@cesarferreira
cesarferreira / optparse-template.rb
Created October 18, 2015 11:07 — forked from rtomayko/optparse-template.rb
Ruby optparse template
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
@cesarferreira
cesarferreira / SomeFragment.java
Created September 24, 2015 17:33 — forked from joshdholtz/SomeFragment.java
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);
android {
// ...
testOptions.unitTests.all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
}
}
}
#!/usr/bin/env python
import os
import re
os.system('git reset --hard HEAD')
os.system('git clean -fdx')
REs = [
r'''\s+\*\n\s+\* @author[^\n]*''',
PATH=$PATH:/Users/cesarferreira/Documents/dev/android-sdk/platform-tools/
PATH=$PATH:$HOME/Dropbox/bin
# Discard all changes since last commit
alias git-wipe='git clean -df & git checkout .'
# go back
alias ..='cd ..'
alias ...='cd ../../'
@interface UILabel (dynamicSizeMe)
-(float)resizeToFit;
-(float)expectedHeight;
@end
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'