Skip to content

Instantly share code, notes, and snippets.

@xleon
xleon / FileStreamAsyncWritter.as
Last active September 30, 2016 14:41
Write bytes to a FileStream in async mode and close stream when finished
package lba.utils
{
import flash.events.IOErrorEvent;
import flash.events.OutputProgressEvent;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
import flash.utils.ByteArray;
import org.osflash.signals.Signal;
using Android.Content;
using Android.Support.Design.Widget;
using Android.Support.V4.View;
using Android.Util;
using Android.Views;
using Java.Interop;
namespace Droid.Helpers
{
public class ScrollAwareFloatingAactionButtonBehavior : CoordinatorLayout.Behavior
@xleon
xleon / fix_permissions.py
Last active January 31, 2018 08:03 — forked from magopian/fix_permissions.py
Django admin command to "fix permissions" (create them properly for proxy models).This is needed because of the following bug in Django (not fixed as of 1.6): https://code.djangoproject.com/ticket/11154
# -*- coding: utf-8 -*-
"""Add permissions for proxy model.
This is needed because of the bug https://code.djangoproject.com/ticket/11154
in Django (as of 1.6, it's not fixed).
When a permission is created for a proxy model, it actually creates if for it's
base model app_label (eg: for "article" instead of "about", for the About proxy
model).
What we need, however, is that the permission be created for the proxy model
itself, in order to have the proper entries displayed in the admin.
"""
Ejemplo simple de calculadora para IVA e IRPF dada una base imponible
"""
from colorama import init, Fore, Back, Style
init()
IVA_PERCENT = 0.21
IRPF_PERCENT = 0.15
CURRENCY = '€'
@xleon
xleon / Android.csproj
Last active March 26, 2021 10:35
Firebase Cloud Management in XAMARIN
<PackageReference Include="Xamarin.Firebase.Messaging" Version="121.0.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Base" Version="117.6.0" />
<PackageReference Include="Xamarin.Google.Dagger" Version="2.27.0" /> <!-- Fixes runtime error class not found -->