Skip to content

Instantly share code, notes, and snippets.


Durai Amuthan Duraiamuthan

View GitHub Profile
Duraiamuthan / gist:53922c04877fc6a11f9369920b97e666
Created Dec 11, 2017
Circular progress bar with animation pause and resume
View gist:53922c04877fc6a11f9369920b97e666
#import "ViewController.h"
@interface ViewController (){
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
Duraiamuthan / gist:f2cf94ef8c43bc5c5ce3bba13bf8d96d
Created Dec 1, 2017
Re-usable windows phone overlay cum progress bar
View gist:f2cf94ef8c43bc5c5ce3bba13bf8d96d
<Grid Background="#C444" Visibility="{Binding showOverlay, Converter={StaticResource BoolToVisibleOrCollapsed}}">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
<ProgressBar Margin="0,15,0,0"
IsIndeterminate="{Binding showOverlay}"
IsEnabled="{Binding showOverlay}" Foreground="Black"/>
<TextBlock Visibility="Visible" Margin="6,6,6,15" Foreground="Black" FontSize="21" TextWrapping="WrapWholeWords" HorizontalAlignment="Center" Text="Loading..."/>
View gist:92f81ed768afbebc2a343632e9f6fe55
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
Duraiamuthan / gist:84a2edb1524e5dce373b7b639cfdd98d
Created Sep 13, 2017
Xamarin Exception Stack(its a crash report)
View gist:84a2edb1524e5dce373b7b639cfdd98d
Xamarin Exception Stack:
System.ArgumentException: Set Method not found for 'Enabled'
at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) <0x10025f858 + 0x00168> in <2f4074c3120b4d80802e10af84b67d41#da126b4d390eed35c2c737c64ac20e68>:0
at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) <0x100260108 + 0x00027> in <2f4074c3120b4d80802e10af84b67d41#da126b4d390eed35c2c737c64ac20e68>:0
at GalaSoft.MvvmLight.Helpers.Binding`2[TSource,TTarget].SetTargetValue (TTarget value) <0x1000b3c64 + 0x0008f> in <2c294505267144d49f6bddafbd88d65a#da126b4d390eed35c2c737c64ac20e68>:0
at GalaSoft.MvvmLight.Helpers.Binding`2[TSource,TTarget].Attach () <0x1000b2734 + 0x001f3> in <2c294505267144d49f6bddafbd88d65a#da126b4d390eed35c2c737c64ac20e68>:0
at GalaSoft.MvvmLight.Helpers.Binding`2[TSource,TTarg
Duraiamuthan / gist:27c952cd6c0ac0269f0b084baa9ef169
Created Jun 30, 2017
MTOUCH : error MT4109: Failed to compile the generated registrar code. - Error log
View gist:27c952cd6c0ac0269f0b084baa9ef169
Building: MyTestProject.iOS (Debug|iPhone)
Build started 30/06/2017 12:07:11.
Project "/Users/durai/Documents/New/MyTestProject/MyTestProject/MyTestProject.csproj" (Build target(s)):
Target ResolveAssemblyReferences:
A TargetFramework profile exclusion list will be generated.
Primary reference "Mono.Android".
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(1980,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Mono.Android". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
For SearchPath "{HintPathFromItem}".
Duraiamuthan / gist:13543ee4ec1115f3c6b263b76b2d8d7c
Last active Jun 30, 2017
MT4109 Failed to compile the generated registrar code - My IDE Information
View gist:13543ee4ec1115f3c6b263b76b2d8d7c
=== Visual Studio Community 2017 for Mac ===
Version 7.0.1 (build 24)
Installation UUID: 31d15ad0-e2b9-4dc5-bc31-0d1691b70a29
Mono (2017-02/5077205) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 500010001
View Base64 image and video
This file has been truncated, but you can view the full file.
base 64 image <br>
<img id='base64image' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='><br>
base 64 video
<video id='base64video' width='320' height='240' controls>
<source src='data:video/x-m4v;base64,AAAAFGZ0eXBxdCAgAAAAAHF0ICAAABGbbW9vdgAAAGxtdmhkAAAAANPPfw7Tz38QAAACWAAAAwsA
Duraiamuthan /
Last active Jun 28, 2016 — forked from chaitanyagupta/
How to re-sign an iOS app with another developer account

To re-sign an iOS app with another developer account, ensure that the following are in place first.

  1. Distribution certificate of the other developer account
  2. A provisioning profile from the other developer account

Note that the Apple requires bundle IDs to be globally unique, even across accounts. So a bundle ID i.e. CFBundleIdentifier from one account can't be used in a different account, even though the team id/prefix would be different.

Ensure that the new distribution certificate is in your keychain and the new provisioning profile on your disk.

  1. Unzip the .ipa. This will usually unzip to Payload/.app/
View gist:d771eef5fa23d9cba2e8
NSAlert *alert=[NSAlert alertWithMessageText:@"message" defaultButton:@"Ok" alternateButton:@"Cancel" otherButton:nil informativeTextWithFormat:@"InformativeText"];
NSInteger i=[alert runModal];
if (i==NSAlertDefaultReturn) {
NSLog(@"Ok pressed");
NSLog(@"Else pressed");
View gist:dd1224d1d43bc501168b
CFUUID is available from iOS 2.0. CoreFoundation package (C style API) provide CFUUID. CFUUIDCreate is the method to create the CFUUIDRef and can get an NSString representation of the created CFUUIDRef like :-
CFUUIDRef cfuuid = CFUUIDCreate(kCFAllocatorDefault);
NSString *cfuuidString = (NSString*)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault, cfuuid));
CFUUID is not persisted, every time you call CFUUIDCreate and will get new unique identifier.
e.g. 68883Q11-4D23-5434-9D60-2250E4C90967