This gist has graduated to a full-fledged repo @ https://github.com/JakeWharton/ProcessPhoenix
/** | |
* Desaturate the given color int value by the provided ratio, down to a minimum of 0.2f. | |
* | |
* Note: Do not pass R.color ints, resolve the actual color int via | |
* getResources().getColor(R.color.your_color_name_here). | |
* | |
* f(x) = ( startSaturation / 1.0f * ratio ) + ( minSaturation * (1.0f - ratio) ) | |
* | |
* @param int The color value to desaturate | |
* @param float The ratio to desatrate by (0.0f - 1.0f) |
private BadgeView mBadgeView; | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getSupportMenuInflater().inflate(R.menu.badge_demo, menu); | |
MenuItem menuItem = menu.findItem(R.id.item_id); | |
ImageButton iconView = new ImageButton(this, null, | |
com.actionbarsherlock.R.style.Widget_Sherlock_ActionButton); | |
iconView.setImageDrawable(menuItem.getIcon()); |
package org.springframework.web.servlet.support; | |
import java.io.IOException; | |
import javax.servlet.FilterChain; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.springframework.web.filter.OncePerRequestFilter; |
import android.graphics.*; | |
import com.squareup.picasso.Transformation; | |
/** | |
* Transforms an image into a circle representation. Such as a avatar. | |
*/ | |
public class CircularTransformation implements Transformation | |
{ | |
int radius = 10; |
Based on the example file from the announcement blog post http://sketchplugins.com/d/87-new-file-format-in-sketch-43
type UUID = string // with UUID v4 format
type SketchPositionString = string // '{0.5, 0.67135115527602085}'
type SketchNestedPositionString = string // '{{0, 0}, {75.5, 15}}'
The syntax below works currently (November 2014) however is not officially supported. It may stop working at any time without warning.
For a list of documented / support template tags and syntax, see: http://help.close.io/customer/portal/articles/823937-email-templates
# 10_basic.py | |
# 15_make_soup.py | |
# 20_search.py | |
# 25_navigation.py | |
# 30_edit.py | |
# 40_encoding.py | |
# 50_parse_only_part.py |
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
} | |
NodeList.prototype.__proto__ = Array.prototype; |