Skip to content

Instantly share code, notes, and snippets.

View saket's full-sized avatar

Saket Narayan saket

View GitHub Profile
@saket
saket / emoji_sad.txt
Last active August 29, 2015 14:19 — forked from mranney/emoji_sad.txt
From: Chris DeSalvo <[email protected]>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <[email protected]>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
@saket
saket / LogHelper
Last active August 29, 2015 14:15 — forked from shkschneider/Log
package com.example.myapp;
import android.text.TextUtils;
import android.util.Log;
/**
* Improved android.util.Log.
*
* Logs class and method automatically:
* [MyApplication onCreate()] Hello, world!
void showFirstNotif(){
mNotifBuilder.setContentTitle("First")
.setContentText("Body")
.setWhen(activityStartTime)
.setSmallIcon(PhotoUtils.getAppIconResId())
.setDefaults(Notification.DEFAULT_ALL)
.setOnlyAlertOnce(true);
NotificationManagerCompat.from(this).notify("Test", NOTIF_ID, mNotifBuilder.build());
import android.animation.ValueAnimator;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.ImageView;
import java.lang.ref.SoftReference;
public class PhotographicPrintAnimator {
/*
* Copyright 2014 Mostafa Gazar
*
* 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
@saket
saket / Makeup
Last active August 29, 2015 14:11 — forked from Trikke/Makeup
package trikke.gists;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.BackgroundColorSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.RelativeSizeSpan;
import android.text.style.StrikethroughSpan;
import android.text.style.StyleSpan;
/*
* Copyright (C) 2014 darnmason
*
* 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
public abstract class HeaderFooterRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private static final int VIEW_TYPE_MAX_COUNT = 1000;
private static final int HEADER_VIEW_TYPE_OFFSET = 0;
private static final int FOOTER_VIEW_TYPE_OFFSET = HEADER_VIEW_TYPE_OFFSET + VIEW_TYPE_MAX_COUNT;
private static final int CONTENT_VIEW_TYPE_OFFSET = FOOTER_VIEW_TYPE_OFFSET + VIEW_TYPE_MAX_COUNT;
private int headerItemCount;
private int contentItemCount;
private int footerItemCount;