Skip to content

Instantly share code, notes, and snippets.

View alejandroschmechel's full-sized avatar

Alejandro Schmechel alejandroschmechel

  • ThoughtWorks
  • Florianópolis, SC
View GitHub Profile
@alfeugds
alfeugds / CurrencyConverter.cs
Last active July 13, 2023 06:01
Xamarin Forms Currency Mask for Entry fields
using System;
using System.Globalization;
using System.Text.RegularExpressions;
using Xamarin.Forms;
namespace MyProject.Util
{
/// <summary>
/// Converter for using in Entry fields for masked input of currency.
/// <para>The binded property must be of type decimal, and must invoke the PropertyChangedEventArgs event whenever the value is changed, so that the desired mask behavior is kept.</para>
@davidtavarez
davidtavarez / LineEntry.cs
Last active April 6, 2022 20:09
Xamarin.Forms Entry just with bottom border.
using Xamarin.Forms;
namespace YOUTNAMESPACE
{
public class LineEntry : Entry
{
public static readonly BindableProperty BorderColorProperty =
BindableProperty.Create<LineEntry, Color> (p => p.BorderColor, Color.Black);
public Color BorderColor {
@jreinke
jreinke / generate.php
Created August 14, 2012 14:45
Default password encoding in Silex micro-framework
<?php
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
$encoder = new MessageDigestPasswordEncoder();
echo $encoder->encodePassword('foo', '');
// 5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==
@alotaiba
alotaiba / google_text2speech.md
Created February 3, 2012 07:31
Google Text to Speech API

Google Text to Speech API

Base URL: http://translate.google.com/translate_tts
It converts written words into audio. It accepts GET requests.

GET

q
The query string to convert to audio

tl
Translation language, for example, ar for Arabic, or en-us for English

@WizardOfOgz
WizardOfOgz / gist:1012107
Created June 7, 2011 12:13
Save Base64-encoded images with Paperclip
class Avatar < ActiveRecord::Base
attr_accessor :content_type, :original_filename, :image_data
before_save :decode_base64_image
has_attached_file :image,
PAPERCLIP_CONFIG.merge(
:styles => {
:thumb => '32x32#',
:medium => '64x64#',