Skip to content

Instantly share code, notes, and snippets.

@rudyryk
rudyryk / ImageMeter.cs
Last active October 6, 2023 11:32
C# — Get image size by name in Xamarin.Forms for iOS and Android platforms
//
// ImageMeter.cs
// Created by Alexey Kinev on 9 May 2015.
//
// No Rights Reserved
// http://creativecommons.org/publicdomain/zero/1.0/
//
// Get image size by name in Xamarin.Forms for iOS and Android platforms.
//
using System;
@rudyryk
rudyryk / Avatar.cs
Last active August 22, 2018 13:51
C# — Simple rounded avatar class example for Xamarin.Forms
//
// Avatar.cs
// Created by Alexey Kinev on 26 Feb 2015.
//
// Licensed under The MIT License (MIT)
// http://opensource.org/licenses/MIT
//
// Simple rounded avatar class example for Xamarin.Forms.
//
using System;
@rudyryk
rudyryk / TextMeter.cs
Last active August 8, 2021 10:53
C# — Measure string size in Xamarin.Forms for iOS and Android platforms
//
// TextMeter.cs
// Created by Alexey Kinev on 11 Feb 2015.
//
// Licensed under The MIT License (MIT)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <[email protected]>
//
// Usage example:
@rudyryk
rudyryk / redactor.imagelink.js
Last active March 26, 2018 11:16
Plugin for Imperavi Redactor v10.x.x -- Insert image by link (feature is missing by default)
@rudyryk
rudyryk / Badge.cs
Last active September 5, 2024 09:51
C# — Xamarin.Forms custom simple badge view + rounded box view via custom renderer
//
// Badge.cs
// Created by Alexey Kinev on 19 Jan 2015.
//
// Licensed under The MIT License (MIT)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <[email protected]>
//
using System;
@rudyryk
rudyryk / Countdown.cs
Last active November 1, 2020 23:46
C# — countdown timer with periodical ticks + Xamarin.Forms binding helper + Basic usage example
//
// Countdown.cs
// Created by Alexey Kinev on 11 Jan 2015.
//
// Licensed under The MIT License (MIT)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <[email protected]>
//
using System;
@rudyryk
rudyryk / build_ios_resizes.py
Created December 23, 2014 10:30
Create retina @2x and non-retina resized images from @3x sized images
#!/usr/bin/env python
import os
import sys
print(sys.executable)
def resize_images_in_path(path, out_dir, imagemagic=False):
"""Build 2x and 1x downsized images by 3x images in directory."""
dirs = os.listdir(path)
@rudyryk
rudyryk / merge_tumblr_blogs.py
Last active September 20, 2019 15:04
Merging Tumblr blogs Python script.
# -*- coding: utf-8 -*-
#
# No Rights Reserved
# http://creativecommons.org/publicdomain/zero/1.0/
"""Merge Tumblr blogs helper.
Load posts from one ("old") blog and copy them to another ("new") one.
The script also tries to prevent duplicates if it will run multiple
times.
@rudyryk
rudyryk / redis_asyncio_mq_demo.py
Last active September 19, 2024 12:35
Simple message queue demo on Redis LPUSH / BRPOP for Python 3.3+ and asyncio.
# No Rights Reserved
# http://creativecommons.org/publicdomain/zero/1.0/
"""Simple message queue demo on Redis LPUSH / BRPOP for Python 3.3+ and asyncio.
See also "Pattern: Reliable queue" at http://redis.io/commands/rpoplpush to get
an idea for improvement.
"""
import asyncio
import aioredis
@rudyryk
rudyryk / powerdnsclient.py
Last active August 29, 2015 14:08
Simple client for PowerDNS.net service API
# -*- coding: utf-8 -*-
#
# No Rights Reserved
# http://creativecommons.org/publicdomain/zero/1.0/
"""
Simple client for PowerDNS.net service API.
"""
from suds.client import Client as BaseClient