Skip to content

Instantly share code, notes, and snippets.

View nseba's full-sized avatar

Sebastian Negomireanu nseba

View GitHub Profile
@nseba
nseba / cloudSettings
Created September 19, 2017 09:22
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-09-19T09:22:00.062Z","extensionVersion":"v2.8.3"}
@nseba
nseba / cloudSettings
Last active May 23, 2018 08:41
Visual Studio Code Sync Settings Gist
{"lastUpload":"2018-05-23T08:41:34.026Z","extensionVersion":"v2.9.2"}
var gulp = require('gulp');
var runSequence = require('run-sequence');
var del = require('del');
var vinylPaths = require('vinyl-paths');
var to5 = require('gulp-6to5');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var yuidoc = require("gulp-yuidoc");
var changelog = require('conventional-changelog');
var assign = Object.assign || require('object.assign');
@nseba
nseba / SampleXaml.xaml
Created October 12, 2012 10:51
Xaml and view model for validation
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Style="{StaticResource FormLabelStyle}" Text="Name"/>
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Name, Mode=TwoWay}" common:Validation.Property="Name" common:Validation.ValidationPlaceholder="{Binding ElementName=NameValidation}" common:Validation.DataContext="{Binding}" />
@nseba
nseba / Generic.xaml
Created October 12, 2012 10:05
Validation Control
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Views="using:Byteflux.Views">
<SolidColorBrush x:Key="ValidationErrorBrush" Color="Orange"/>
<Style x:Key="ValidationTextStyle" TargetType="TextBlock" BasedOn="{StaticResource ItemTextStyle}">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Foreground" Value="{StaticResource ValidationErrorBrush}"/>
@nseba
nseba / ViewModel.cs
Created October 11, 2012 16:36
ViewModel with validation support using INotifyDataErrorInfo
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.CompilerServices;
class ViewModel : INotifyDataErrorInfo, INotifyPropertyChanged
{
@nseba
nseba / Validation.cs
Created October 11, 2012 16:25
Windows 8 WinRT XAML Validation helpers
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
public static class Validation
{
#region Property
@nseba
nseba / OpenUrlInDefaultBrowser.cs
Created September 22, 2012 09:11
Open URL in default browser from elevated app
public void OpenUrlInDefaultBrowser(string url)
{
if(UacHelper.IsUacEnabled && UacHelper.IsProcessElevated)
{
var processStartInfo = new ProcessStartInfo("explorer.exe", url);
processStartInfo.UseShellExecute = true,
processStartInfo.Verb = "runas"
Process.Start(processStartInfo);
}
else