Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
Is this Slack?

Pablisco pablisco

🤔
Is this Slack?
View GitHub Profile
@pablisco
pablisco / HeadListFragment.java
Created Jun 17, 2014
How to ensure that we can add a footer to the list in a list fragment
View HeadListFragment.java
import android.os.Build;
import android.support.v4.app.ListFragment;
public class HeadListFragment extends ListFragment {
@Override
public void setListAdapter(ListAdapter adapter) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
View gist:bf8de851e4c1344e8bd6
/*
GETS ?offset:integer?limit:integer
/users/[:id] {
id:string // object property
name:string
}
GET #id:string // url segments (bits in the url)
// plural tells us the get returns a collection
GETS ?search:string?distance:string // url params
View GitUtils
class GitUtils {
def final static NO_BRANCH = new Branch(name: "NO_BRANCH")
def final static NO_TAG = new Tag(name: "NO_TAG")
static class Tag implements CharSequence {
private @Delegate CharSequence name
@Override
View designer.html
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>
View gist:cd2336b25bbbd6a97550
/*
* Copyright (c) 2014 Work Angel Ltd. All rights reserved.
*/
package com.wam.persistency.model.evolutions;
/**
* Created by pablisco on 14/10/2014.
*/
public enum ModelEvolution {
View designer.html
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@pablisco
pablisco / FrameControl.h
Created Sep 28, 2011
Extension to control the UIView frame
View FrameControl.h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface FrameControl : NSObject {
UIView *view;
CGRect originalFrame;
CGRect frame;
BOOL changed;
}
View Command.java
public interface Command {
void do();
// getters
}
View SimpleInitiationTest.java
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Random;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class SimpleInitiationTest {
View Result.java
public final class Result<S, F> {
private final Optional<S> success;
private final Optional<F> failure;
public Result(Optional<S> success, Optional<F> failure) {
this.success = success;
this.failure = failure;
}