Skip to content

Instantly share code, notes, and snippets.

🏠
Working

Ivan Terekhin JEuler

🏠
Working
Block or report user

Report or block JEuler

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JEuler
JEuler / propn.DotSettings
Created Sep 10, 2013
Gist for INotifyPropertyChanged Property within Resharper Live Template
View propn.DotSettings
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=7F89BC92CB2B9341B730F25D72B06C03/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=7F89BC92CB2B9341B730F25D72B06C03/Shortcut/@EntryValue">propn</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=7F89BC92CB2B9341B730F25D72B06C03/Description/@EntryValue">Property with RaisePropertyChanged</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=7F89BC92CB2B9341B730F25D72B06C03/Text/@EntryValue">private $Type$ _$pName$;&#xD;
public $Type$ $Name$&#xD;
{&#xD;
get { return _$pName$; }&#xD;
set&#xD;
{&#xD;
@JEuler
JEuler / cmd.DotSettings
Created Sep 10, 2013
Resharper Live Template for Command-Method thing, within MVVM
View cmd.DotSettings
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A5EC5B6595190D44B55F260E55AE9B01/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A5EC5B6595190D44B55F260E55AE9B01/Shortcut/@EntryValue">trig</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A5EC5B6595190D44B55F260E55AE9B01/Description/@EntryValue">Create interaction trigger.</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=A5EC5B6595190D44B55F260E55AE9B01/Text/@EntryValue">&lt;i:Interaction.Triggers&gt;&#xD;
&lt;i:EventTrigger EventName="$EventName$"&gt;&#xD;
&lt;cmd:EventToCommand Command="{Binding $Command$}" /&gt;&#xD;
&l
@JEuler
JEuler / cmdCS.DotSettings
Created Sep 19, 2013
CMD template for MVVM stuff in .cs files
View cmdCS.DotSettings
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=5514B69ED2205C46A8053CB3E6013819/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=5514B69ED2205C46A8053CB3E6013819/Shortcut/@EntryValue">cmd</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=5514B69ED2205C46A8053CB3E6013819/Description/@EntryValue">Command in MVVM .cs</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=5514B69ED2205C46A8053CB3E6013819/Text/@EntryValue">public ICommand $Name$Command { get; private set; }&#xD;
private void $Name$()&#xD;
{&#xD;
$END$&#xD;
} </s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplate
@JEuler
JEuler / res.DotSettings
Last active Dec 31, 2015
Res live template for Resharper, useful for localization.
View res.DotSettings
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=2CC977F4AE46A64FB65FC6859877C200/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=2CC977F4AE46A64FB65FC6859877C200/Shortcut/@EntryValue">res</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=2CC977F4AE46A64FB65FC6859877C200/Text/@EntryValue">{Binding Path=LocalizedResources.$RESOURCE_NAME$, Source={StaticResource LocalizedStrings}}</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=2CC977F4AE46A64FB65FC6859877C200/Reformat/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=2CC977F4AE46A64FB65
@JEuler
JEuler / ctxvm.DotSettings
Created Feb 6, 2015
Context for View (MVVM light)
View ctxvm.DotSettings
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=78FA8D85D5112D46B0C0176BBE4641C5/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=78FA8D85D5112D46B0C0176BBE4641C5/Shortcut/@EntryValue">ctxvm</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=78FA8D85D5112D46B0C0176BBE4641C5/Text/@EntryValue">DataContext="{Binding $NAME$, Source={StaticResource Locator}}"</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=78FA8D85D5112D46B0C0176BBE4641C5/Reformat/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=78FA8D85D5112D46B0C0176BBE4641C5/ShortenQuali
View isIntentAvailable.java
// check intent for run
public boolean isIntentAvailable(Intent intent) {
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(intent, 0);
return activities.size() > 0;
}
@JEuler
JEuler / observer_template.java
Created Nov 27, 2017
Typical observer live template
View observer_template.java
private class $CLASS_NAME$ implements ResubscriptionObserver<$SUB_CLASS_NAME$> {
@Override
public String resubscriptionTag() {
return $OBSERVER_STRING_TAG$
}
@Override
public void onCompleted() {
}
@JEuler
JEuler / config.yml
Created Jan 3, 2018
basic circle ci 2.0 configuration for Android
View config.yml
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-26-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
@JEuler
JEuler / localizedActivity.kt
Created Feb 26, 2018
Class for the runtime switch of localization
View localizedActivity.kt
// Class for the runtime switch of localization
@SuppressLint("Registered")
open class LocalizedActivity : AppCompatActivity() {
override fun attachBaseContext(newBase: Context) {
super.attachBaseContext((updateBaseContextLocale(newBase)))
}
private fun updateBaseContextLocale(context: Context): Context {
val language = PreferenceManager.getDefaultSharedPreferences(context).getString("languages", Locale.getDefault().language)
val locale = Locale(language)
@JEuler
JEuler / ShowDebugKeyFingerprints.sh
Created May 9, 2018 — forked from j796160836/ShowDebugKeyFingerprints.sh
Show android debug key's fingerprints. (MD5 / SHA1 / SHA256)
View ShowDebugKeyFingerprints.sh
#!/bin/bash
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
You can’t perform that action at this time.