- Grab MiKTeX 2.9 and install. It doesn't really matter whether you get the complete or basic system, as the basic system will download packages as needed.
- Grab TeXstudio and install.
- Fire up TeXstudio and hit Options -> Configure TexStudio.
- Under "Commands", change "Bibtex" from "bibtex %" to "bibtex8 %" (bibtex8 is later and greater and is needed for biblatex, which is better than bibtex for reference handling).
- Under "Quick Build", check "PdfLaTeX + Ldf Viewer". Not all LaTeX compilers were created equal, and Pdf is likely the format you'll want.
- If you're feeling adventurous, go to "Editor" and change the font family to "Consolas" :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From bcrypt-ruby gem | |
require 'bcrypt' | |
class User | |
include DataMapper::Resource | |
attr_accessor :password, :password_confirmation | |
property :id, Serial | |
property :username, String, :required => true, :length => (2..32), :unique => true | |
property :password_hash, String, :length => 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[*.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) => | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Caliburn.Micro; | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ValidationTest | |
{ |
These examples were created during a discussion with j416 on #github about how best to manage long-running feature branches.
The scenario is this: You have a long-running feature branch, based off master. The feature branch and master both touch the same parts of the same files, so you know that there will be conflicts when you finally merge the feature branch in. What can you do to minimise the conflicts?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ReactiveExtensionsExtensions | |
{ | |
public static async Task SubscribeAsync<T>(this IObservable<T> observable, Action<T> onNext, CancellationToken? cancellationToken = null) | |
{ | |
CancellationToken token = cancellationToken ?? CancellationToken.None; | |
var cts = new TaskCompletionSource<bool>(); | |
using(token.Register(() => cts.SetCanceled())) | |
{ | |
observable.Subscribe(onNext, ex => cts.SetException(ex), () => cts.SetResult(true), token); | |
await cts.Task; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.