Skip to content

Instantly share code, notes, and snippets.

View olexale's full-sized avatar
🎯
Focusing

Oleksandr Leushchenko olexale

🎯
Focusing
View GitHub Profile
@olexale
olexale / modified_son_of_obsidian.json
Last active August 29, 2015 14:10
"Son Of Obsidian" theme for Xamarin Studio
View modified_son_of_obsidian.json
{
"name":"Son Of Obsidian",
"version":"1.0",
"originator":"Imported from /Users/ole/Library/XamarinStudio-4.0/HighlightingSchemes/son-of-obsidian.vssettings",
"baseScheme":"son-of-obsidian",
"colors":[
{"name": "Fold Cross", "color":"#A29191", "secondcolor":"#E2E2E2" } ],
"text":[
{"name": "Selected Text", "fore":"#FFFFFF", "back":"#43686C" },
{"name": "Selected Text(Inactive)", "back":"#385A5E" }
@olexale
olexale / gist:e4ed077acfd396605ac1
Created December 11, 2014 09:34
MvvmCross snippets for Xamarin Studio
View gist:e4ed077acfd396605ac1
Shortcut: cmvx
Group: C#
Description: ICommand
Mime: text/x-csharp
Template text:
ICommand _$myCommand$;
@olexale
olexale / android_sceenshot.sh
Created December 13, 2014 08:34
Android screenshot script
View android_sceenshot.sh
#!/bin/sh
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
@olexale
olexale / cmvx.snippet
Created October 28, 2013 13:44
MvvmCross snippets for Visual Studio
View cmvx.snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>MvvmCross command</Title>
<Shortcut>cmvx</Shortcut>
<Description>Code snippet for MvvmCross command</Description>
</Header>
View CounterState.cs
class CounterState
{
public CounterState(int count) { Count = count; }
public int Count { get; }
}
View actions.cs
class IncrementAction { }
class DecrementAction { }
View CounterReducer.cs
class CounterReducer
{
public CounterState Reduce(CounterState state, object action)
{
switch (action)
{
case IncrementAction i:
return ProcessIncrement(state);
case DecrementAction d:
return ProcessDecrement(state);
View CounterStore.cs
class CounterStore : INotifyPropertyChanged
{
private readonly CounterReducer reducer = new CounterReducer();
private CounterState state;
public CounterStore(CounterState initialState)
{
state = initialState;
}
View TransitionAnimator.cs
public class TransitionAnimator : UIViewControllerAnimatedTransitioning
{
private const double _duration = 0.5;
public override void AnimateTransition(IUIViewControllerContextTransitioning transitionContext)
{
var containerView = transitionContext.ContainerView;
var toView = transitionContext.GetViewFor(UITransitionContext.ToViewKey);
containerView.AddSubview(toView);
View AnimationNavigationControllerDelegate.cs
public class AnimationNavigationControllerDelegate : UINavigationControllerDelegate
{
private TransitionAnimator _animator = new TransitionAnimator();
public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
{
return _animator;
}
}