Skip to content

Instantly share code, notes, and snippets.

View rmujica's full-sized avatar
:shipit:
I may be slow to respond.

René Mujica Moreau rmujica

:shipit:
I may be slow to respond.
View GitHub Profile
@gabrielemariotti
gabrielemariotti / MaterialLargeImageCard.java
Created September 2, 2014 17:41
A simple gist to build a MaterialCard with cardslib v2.
//Create a Card, set the title over the image and set the thumbnail
MaterialLargeImageCard card = new MaterialLargeImageCard(getActivity());
card.setTextOverImage("Italian Beaches");
card.setDrawableCardThumbnail(R.drawable.sea);
//Set the title and subtitle in the card
card.setTitle("This is my favorite local beach");
card.setSubTitle("A wonderful place");
// Set supplemental actions
/*
* Copyright (C) 2015 J.T. Gilkeson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@iheanyi
iheanyi / NowArrayAdapter.java
Last active February 10, 2019 17:32
Google Now Cards Layout XML. list_item.xml can be customized to your heart's content . . . Also, you can implement the following with DragSortListView for swiping to delete, reordering, and whatnot.
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
@FSX
FSX / tornado_thread_pool.py
Created May 2, 2012 16:02
A simple thread pool for Tornado.
#!/usr/bin/env python
# Thread pool based on: http://code.activestate.com/recipes/577187-python-thread-pool/
from queue import Queue
from threading import Thread
from functools import partial
import tornado.httpserver
import tornado.ioloop
import tornado.options
@bhaumiknsoni
bhaumiknsoni / CustomSwipeToRefresh.java
Last active August 20, 2019 00:47
Customized SwipeRefreshLayout for setting swipe distance to refresh.
package com.sungardas.viewpoint.widget;
import android.content.Context;
import android.os.Build;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewTreeObserver;
@sbrl
sbrl / Vector.mjs
Last active August 30, 2019 03:50
[Vector.mjs] A simple ES6 Vector class. #microlibrary
"use strict";
/******************************************************
************** Simple ES6 Vector2 Class **************
******************************************************
* Author: Starbeamrainbowlabs
* Twitter: @SBRLabs
* Email: feedback at starbeamrainbowlabs dot com
*
* From https://gist.github.com/sbrl/69a8fa588865cacef9c0
'use strict';
/*
* Binary search tree with in-order iteration.
* http://greim.github.io/gen/dist/00-intro.html
*/
class Tree {
add(value) {
if (this.root) this.root.add(value);
@donnfelker
donnfelker / android-19-circle.yml
Last active March 12, 2021 13:19
Sample CircleCI Configuration For an Android App
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/your-app-name/app/build/outputs/apk/
machine:
environment:
@jgilfelt
jgilfelt / AndroidMapsDirectionsIntent.java
Created July 27, 2010 07:56
Android Maps - Directions between two points Intent
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?f=d&saddr=53.447,-0.878&daddr=51.448,-0.972"));
intent.setComponent(new ComponentName("com.google.android.apps.maps",
"com.google.android.maps.MapsActivity"));
startActivity(intent);
@FSX
FSX / async_psycopg2.py
Created March 8, 2011 22:11
A module for asynchronous PostgreSQL queries in Tornado.
#!/usr/bin/env python
__author__ = 'Frank Smit <frank@61924.nl>'
__version__ = '0.1.0'
import functools
import psycopg2
from tornado.ioloop import IOLoop, PeriodicCallback