Skip to content

Instantly share code, notes, and snippets.

View efranford's full-sized avatar

Elliot Franford efranford

View GitHub Profile
@pasmat
pasmat / Boxer.java
Created August 22, 2018 14:25
Data-binded values that are boxed(such as ones that come from Kotlin, as there's no primitive types in Kotlin..) requires safe unboxing, so there's no NPE(null pointer exception) when binding data. Theres a method for this safeUnbox inside Android SDK, however this doesn't support two-way data binding. Therefore we have to define these two-way s…
package fi.matalamaki.util;
import androidx.databinding.InverseMethod;
/**
* Data-binded values that are boxed(such as ones that come from Kotlin,
* as there's no primitive types in Kotlin..) requires safe unboxing,
* so there's no NPE(null pointer exception) when binding data.
*
* Theres a method for this safeUnbox inside Android SDK,
@lopspower
lopspower / README.md
Last active May 23, 2024 07:29
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@mrflip
mrflip / tuning_storm_trident.asciidoc
Last active May 27, 2022 23:59
Notes on Storm+Trident tuning

Tuning Storm+Trident

Tuning a dataflow system is easy:

The First Rule of Dataflow Tuning:
* Ensure each stage is always ready to accept records, and
* Deliver each processed record promptly to its destination
@scottrippey
scottrippey / jQuery.antiforgerytoken.js
Created August 22, 2012 18:21
ASP.NET MVC AntiForgeryToken + AJAX = jQuery to the rescue
// Setup CSRF safety for AJAX:
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
if (options.type.toUpperCase() === "POST") {
// We need to add the verificationToken to all POSTs
var token = $("input[name^=__RequestVerificationToken]").first();
if (!token.length) return;
var tokenName = token.attr("name");