I hereby claim:
- I am davidblurton on github.
- I am davidblurton (https://keybase.io/davidblurton) on keybase.
- I have a public key ASBTd-PsNR63x3266ilFt1InXJqgZ5xWK33aqwRct1oGmQo
To claim this, I am signing this object:
function capitalize(str) { | |
return str[0].toUpperCase() + str.slice(1) | |
} |
function countdownToChristmas(date) { | |
const daysLeft = 24 - date | |
if (daysLeft > 0) { | |
return `${daysLeft} days till Christmas!` | |
} | |
} | |
const date = new Date().getDate() | |
countdownToChristmas(date).toUpperCase() |
Array.prototype.max = function() { | |
return Math.max.apply(Math, this); | |
}; | |
[1,2,3].max(); // => 3 | |
Array.prototype.all = function() { | |
return [].every.apply(this, [].slice.call(arguments)); | |
}; |
(mergesort [6 4 2 3 5 1]) | |
(defn mergesort [x] | |
(if (< (count x) 2) x | |
(let [half (quot (count x) 2)] | |
(merge (mergesort (take half x)) (mergesort (drop half x)))))) | |
(defn merge[a, b] | |
(if (empty? a) b | |
(if (empty? b) a |
I hereby claim:
To claim this, I am signing this object:
using (FolderBrowserDialog browseDialog = new FolderBrowserDialog()) | |
{ | |
if (browseDialog.ShowDialog() == DialogResult.OK) | |
{ | |
m_Path.Text = browseDialog.SelectedPath; | |
} | |
} |
// ReSharper disable CheckNamespace | |
namespace System.Runtime.CompilerServices | |
// ReSharper restore CheckNamespace | |
{ | |
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] | |
public sealed class CallerMemberNameAttribute : Attribute | |
{ | |
} | |
} |
/// <summary> | |
/// Interaction logic for App.xaml | |
/// </summary> | |
public partial class App : Application | |
{ | |
... | |
protected override void OnStartup(StartupEventArgs e) | |
{ | |
EventManager.RegisterClassHandler(typeof(TextBox), UIElement.GotFocusEvent, new RoutedEventHandler(TextBox_GotFocus)); |
InitializeComponent(); | |
Loaded += (sender, e) => MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); |
public abstract class ViewModel : INotifyPropertyChanged | |
{ | |
public event PropertyChangedEventHandler PropertyChanged; | |
[NotifyPropertyChangedInvocator] | |
protected void RaisePropertyChanged([CallerMemberName] string propertyName = string.Empty) | |
{ | |
if (propertyName = string.Empty) | |
{ | |
throw new NotSupportedException("Cannot raise property changed on an empty property name. Make sure you are using the C# 5 compiler to make CallerMemberName work.") |