Skip to content

Instantly share code, notes, and snippets.

View emilsjolander's full-sized avatar
⚒️
Building things

Emil Sjölander emilsjolander

⚒️
Building things
View GitHub Profile
{
"version": "0.0.1",
"root": {
"kind": "flexbox",
"props": {
"flex-direction": "column",
"children": [
{
"kind": "text",
"props": {
{
"version": "0.0.1",
"root": {
"kind": "flexbox",
"props": {
"flex-direction": "column",
"children": [
{
"kind": "text",
"props": {
{
"version": "0.0.1",
"root": {
"kind": "flexbox",
"props": {
"flex-direction": "column",
"children": [
{
"kind": "text",
"props": {
@emilsjolander
emilsjolander / gist:211253741615d62d39fc
Created June 19, 2014 21:07
StickyListHeaders resizing headers
package se.emilsjolander.stickylistheaders.sample;
import android.annotation.TargetApi;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
@emilsjolander
emilsjolander / callbacks.java
Created April 5, 2014 13:14
pre and post migration callbacks
void onCreate() {
Sprinkles s = Sprinkles.init(this);
s.migrate(
new Migration() {
void onPreMigrate() {
// TODO query data in id column
}
void migrate() {
@emilsjolander
emilsjolander / migrtions.java
Created April 5, 2014 12:47
Sprinkles new migration system
/*
pros:
- Simple and little code
cons:
- What happens when an @Check annotation is removed form Note.class model?
Not intuitive that that column will be dropped and recreated
*/
void onCreate() {
@emilsjolander
emilsjolander / gist:9991234
Created April 5, 2014 12:14
spinkles new migration api
void onCreate() {
Sprinkles s = Sprinkles.init(this);
s.registerTypeSerializer(...)
s.registerTypeSerializer(...)
s.registerModel(Note.class)