Skip to content

Instantly share code, notes, and snippets.

//
// UPnP.cs: UPnP Device Discovery Test.
//
// Authors:
// Eric Butler <eric@extremeboredom.net>
//
// (C) 2006 FileFind.net (http://filefind.net)
//
using System;
@mwisnicki
mwisnicki / App.xaml.cs
Created July 13, 2012 13:45
[WPF] Handle Loaded event globally
using System;
using System.Windows;
namespace WpfLoadedClassHandler
{
/// <summary>
/// Shows how to globally handle Loaded event.
/// Workarounds bug: https://connect.microsoft.com/VisualStudio/feedback/details/511753/window-loadedevent-doesnt-work-properly-when-used-to-register-a-class-event-handler
/// Discussed: http://stackoverflow.com/questions/11455800/routed-event-class-handler-for-loadedevent-does-not-work-for-most-classes
/// </summary>
Say you are in a world where you want to use progressive enhancement (sometimes for accessibility)
with ASP.NET MVC 3+.
Progressive Enhancement means the site WORKS WITHOUT JAVASCRIPT FOLKS.
Now say you have something like comments that will be on multiple pages.
You want the site to be maintainable so you want to use a partial with
form submission.
@yreynhout
yreynhout / ESInTheBrowser.html
Last active December 27, 2015 02:29
Parking
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/json2/20121008/json2.js"></script>
<script>
var AggregateRootEntity =
function AggregateRootEntityConstructor(options, my) {
var that = {},
handlers = options.handlers || {},
changes = [];
@yreynhout
yreynhout / MemoryProjectionBuilder.cs
Last active August 29, 2015 14:01
Parking it here
using System;
using System.Linq;
namespace FiveMinuteProject
{
public class ProjectionBuilder<TState>
{
private readonly ProjectionHandler<TState>[] _handlers;
public ProjectionBuilder()
public class AreaFallowed
{
public AreaFallowed(string gardenID, NodaTime.LocalDate date, int x, int y, int width, int length)
{
GardenId = gardenID;
Date = date;
X = x;
Y = y;
Width = width;
Length = length;
internal class MassTransitDispatcher : IObserver<ICommit>
{
private readonly IServiceBus _bus;
public MassTransitDispatcher(IServiceBus bus)
{
_bus = bus;
}
public void Dispose()
static App()
{
var lang = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag);
FrameworkElement.LanguageProperty.OverrideMetadata(
typeof(FrameworkElement), new FrameworkPropertyMetadata(lang)
);
var ceTypes = new Type[] {
typeof(System.Windows.Controls.DefinitionBase),
@davidfowl
davidfowl / dotnetlayout.md
Last active June 3, 2024 23:39
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@atiensivu
atiensivu / GnomeShellExtensions
Created September 11, 2017 20:13
Gnome Tweak Tool - enable user themes - No such schema “org.gnome.shell.extensions.user-theme”
sudo cp $HOME/.local/share/gnome-shell/extensions/user-theme@gnome-shell-extensions.gcampax.github.com/schemas/org.gnome.shell.extensions.user-theme.gschema.xml /usr/share/glib-2.0/schemas && sudo glib-compile-schemas /usr/share/glib-2.0/schemas
# One liner fix that shouldn't be necessary