Skip to content

Instantly share code, notes, and snippets.

View ##java takeover.txt
14:50 *** @ChanServ has changed the topic to: Welcome to ##java. Freenode community channel for java. Please keep it civil and dont spam or be political.
14:55 <cheeser> the fuck?
14:56 <cheeser> so i guess ##java has officially been hijacked by our new overlords.
14:59 <dreamreal> I wonder what the trigger was.
15:00 <dreamreal> Did they notify you at all?
15:02 <cheeser> not at all
15:03 <cheeser> so for the rest of you still here good luck. if you want something active, we're all at libera.
15:04 <dreamreal> Java has been taken over by freenode staff, given that they weren't acting as if they deserved to be trusted, and then acted upon that distrust. The old ops have set up shop in #java on libera.chat. If you want, join us there. if not, cool beans.
15:05 <@sorcerer> actually you guys failed to deal with spam thats what brought me here
15:06 <Maldivia> considering there has been no spam here, that's rich
View git-ffwd.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@canton7
canton7 / TreeViewExtensions.cs
Last active Oct 16, 2019
Read TreeView SelectedItem
View TreeViewExtensions.cs
public static class TreeViewExtensions
{
private static readonly object initialBindingTarget = new object();
public static object GetSelectedItem(DependencyObject obj) => obj.GetValue(SelectedItemProperty);
public static void SetSelectedItem(DependencyObject obj, object value) => obj.SetValue(SelectedItemProperty, value);
public static readonly DependencyProperty SelectedItemProperty =
DependencyProperty.RegisterAttached("SelectedItem", typeof(object), typeof(TreeViewExtensions), new FrameworkPropertyMetadata(initialBindingTarget, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, (d, e) =>
{
View TreeViewExtensions.cs
/// <summary>
/// Extensions on TreeViews allowing users to bind to the SelectedItem property
/// </summary>
public static class TreeViewExtensions
{
private static readonly object initialBindingTarget = new object();
public static object GetSelectedItem(DependencyObject obj)
{
return obj.GetValue(SelectedItemProperty);
View .editorconfig
[*.cs]
# Standard EditorConfig settings
indent_style = space
indent_size = 4
# .NET code style settings
# See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2019
# This section lists all of the rules from the above link, in order
View EqualityAndComparisons.cs
public readonly struct EquatableStruct : IEquatable<EquatableStruct>
{
private readonly float valueMember;
private readonly Version referenceMember;
public bool Equals(EquatableStruct other)
{
// Compare value types using == (or .Equals)
// Compare reference types for equality using Equals(object, object)
// to be safe to null references.
View ApplicationMutex.cs
public class ApplicationMutex : IDisposable
{
private static readonly ILog logger = LogManager.GetLogger(typeof(ApplicationMutex));
// This needs to have the prefix "Global\" in order to be system-wide
public const string MutexName = @"Global\MyApplicationNameMutex";
private Mutex mutex;
private bool acquired;
View RestEaseSampleApplication.cs
namespace RestEaseSampleApplication
{
// We receive a JSON response, so define a class to deserialize the json into
public class User
{
public string Name { get; set; }
public string Blog { get; set; }
// This is deserialized using Json.NET, so use attributes as necessary
[JsonProperty("created_at")]
View TreeViewExtensions.cs
/// <summary>
/// Extensions on TreeViews allowing users to bind to the SelectedItem property
/// </summary>
/// <remarks>
/// The trick used to detect when the binding has occurred means that there are some cases it doesn't handle - but I don't
/// recall what.
/// </remarks>
public static class TreeViewExtensions
{
private static readonly object initialBindingTarget = new object();
View Localization Platform Rundown.md
  1. Pootle: Self-hosted. Slightly annoying to get set up, seems to work thereafter. Uses a command-line tool to upload/download translations. Didn't evaluate too much.
  2. Weblate: Self-hosted offshoot of Pootle. Very annoying to set up. Seems to have a nicer interface but wants to integrate directly with your VCS - no command-line tooling. The VCS integration adds a lot of complexity. Didn't evaluate too much.
  3. Zanata: Self-hosted, easy to set up. Poor access controls - geared towards open collaboration. Command-line tool. Nice interface.
  4. POEditor: Paid hosting, with a free tier. No command-line tool as far as I can see.
  5. CrowdIn: Paid hosting, free for open source. Very nice interface, good API and command-line tooling. Good GitHub integration. This is the one we went for.