Skip to content

Instantly share code, notes, and snippets.

View pablisco's full-sized avatar
🤔
Is this Slack?

Pablisco pablisco

🤔
Is this Slack?
View GitHub Profile
@pablisco
pablisco / HeadListFragment.java
Created June 17, 2014 09:29
How to ensure that we can add a footer to the list in a list fragment
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) {
/*
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
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
@pablisco
pablisco / designer.html
Created October 11, 2014 18:19
designer
<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>
/*
* 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 {
@pablisco
pablisco / designer.html
Created November 16, 2014 21:21
designer
<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 September 28, 2011 14:03
Extension to control the UIView frame
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface FrameControl : NSObject {
UIView *view;
CGRect originalFrame;
CGRect frame;
BOOL changed;
}
public interface Command {
void do();
// getters
}
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 {
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;
}