Skip to content

Instantly share code, notes, and snippets.

View moagrius's full-sized avatar

Mike Dunn moagrius

  • Austin, TX
View GitHub Profile
@moagrius
moagrius / center_contain_layout.xml
Created July 1, 2016 17:36
XML use of CenterContainViewGroup
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.michaeldunn.experiments.widgets.CenterContainViewGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:natural_height="1080"
@moagrius
moagrius / CenterContainViewGroup.java
Last active July 1, 2016 17:48
This is a re-usable widget that accepts one child. That child will always show as much of that child as possible, without clipping, and extending to the appropriate edge, then centered in the remaining space.
package com.michaeldunn.experiments.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import com.michaeldunn.experiments.R;
import android.app.Service;
import android.content.Intent;
import android.media.MediaCodec;
import android.net.Uri;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;
import android.view.Surface;
import android.widget.MediaController;
// add your package here
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.graphics.SurfaceTexture;
import android.net.Uri;
import android.os.Bundle;
import android.os.IBinder;

Composer

Composer UI interacts with the Python WSGI app at https://github.com/dailydot/composer to manage article content.

Rather than allowing markup to structure content, Composer uses the concept of Nodes. A Node represents a piece of content, such as a paragraph, an image, a heading, a list of text items, or more sophisticated third-party content sources called embeds.

At the top level, Composer uses a dot.cms.editor.Editor instance to manage dot.cms.editor.articles.Article instances. An Editor instance will manage a single Article instance at a time, but that Article instance can be replaced, removed,

Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.6.10
Python Version: 2.7.6
Installed Applications:
('ordered_m2m',
@moagrius
moagrius / MainActivity
Created May 9, 2013 05:32
Resizable MapView (centers to container)
package com.qozix.mapviewdemo;
import android.app.Activity;
import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;
import android.widget.RelativeLayout;
import com.qozix.mapview.MapView;
import com.qozix.mapview.MapView.MapEventListenerImplementation;